I have added the DEAL_II_DIR variable in the cmake section of vscode  as 
follows:[image: picture1.png]

Also, i have added the following lines to the .bashrc file for setting up 
the environment:

export SPACK_ROOT=/home/vinayak/spack
export PATH="$SPACK_ROOT/bin:$PATH"

MODULES_HOME=$(spack location -i environment-modules)
source ${MODULES_HOME}/init/bash
. $SPACK_ROOT/share/spack/setup-env.sh

Now I get a different error:
`
cannot open source file "mpi.h" (dependency of "deal.II/grid/tria.h")
`
And i am still not able to use dealii upon terminal launch without using 
"spack load dealii". Not sure what more changes i need to make to the 
vscode setting to make this work. Can you point me to it? 

Thanks
Vinayak
On Sunday, April 23, 2023 at 11:02:53 AM UTC+2 luca....@gmail.com wrote:

> Vscode does not call “spack load dealii “ by itself. If you want to be 
> able to compile with vscode , you have two options: you instruct it where 
> it can find dealii (setting variables in the cmake section of vscode 
> settings) or adding the relevant variables to your shell initialization 
>  files. If you open a new terminal and you are able to compile deal 
> tutorials without calling any additional commands, then vscode will work.  
>
> Luca
>
> Il giorno 23 apr 2023, alle ore 11:35, Vinayak Vijay <vinay...@gmail.com> 
> ha scritto:
>
> 
>
> "Do you have the cmake extension installed in vscode?" - Yes
>
> The thing is that i have installed dealii using spack. So everything works 
> smoothly if i just try to build from the terminal but not when i try to 
> build using vscode cmake extension. I think VSCode (or vscode cmake 
> extension) is not able to recognize the environment variable DEAL_II_DIR 
> even when "spack load dealii" command is made from the vscode terminal. 
>
> Vinayak
>
> On Saturday, April 22, 2023 at 7:50:23 PM UTC+2 luca....@gmail.com wrote:
>
>> Cmake does not know where to find a correct version of deal.ii. 
>>
>> Are you trying to compile an example from the GitHub repository with an 
>> earlier release of deal.ii? If that’s the case, try removing the version 
>> from the find statement in the CMakeLists.txt. Otherwise you will have to 
>> instruct vscode where your library is installed. You can initiate cmake 
>> from the command line in the build directory manually, specifying the env 
>> variable DEAL_II_DIR. When a cmake cache is present, vscode uses it, and 
>> you may be able to get through. 
>>
>> Luca
>>
>> Il giorno 22 apr 2023, alle ore 20:18, Abbas <abbas.b...@gmail.com> ha 
>> scritto:
>>
>> Do you have the cmake extension installed in vscode? 
>>
>> If not give it a try
>>
>> Abbas
>>
>> On Saturday, April 22, 2023 at 1:44:41 PM UTC+2 vinay...@gmail.com wrote:
>>
>>> Hi,
>>>
>>> I am trying to build step-1 using cmake on vscode. But vscode throws me 
>>> this error:
>>>
>>> `
>>> CMake Error at CMakeLists.txt:30 (message):
>>>
>>> *** Could not locate a (sufficiently recent) version of deal.II.  ***
>>>
>>>
>>>
>>> You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to 
>>> cmake
>>>
>>> or set an environment variable "DEAL_II_DIR" that contains this path.
>>>
>>> `
>>> I have installed dealii using spack. I am able to build using the 
>>> terminal though. What changes do i need to make for building using vscode?
>>>
>>> Thanks 
>>> Vinayak
>>>
>>> -- 
>> The deal.II project is located at http://www.dealii.org/
>> For mailing list/forum options, see 
>> https://groups.google.com/d/forum/dealii?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "deal.II User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to dealii+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/ade9af1e-1787-4840-b9db-c49e45dc6cc3n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/dealii/ade9af1e-1787-4840-b9db-c49e45dc6cc3n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to dealii+un...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/70f20c32-2221-4195-9e1f-cb23c10507e1n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/dealii/70f20c32-2221-4195-9e1f-cb23c10507e1n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/3d3b0468-d243-4f8d-81d4-74dbe7ff4fb8n%40googlegroups.com.

Reply via email to