Configuring IBAMR with sublime text 3 on Ubuntu 14.04 LTS

79 views
Skip to first unread message

Ramakrishnan Thirumalaisamy

unread,
May 17, 2019, 8:33:32 AM5/17/19
to ibam...@googlegroups.com
Hi,

I am Ramakrishnan and I am a student of Amneet Bhalla. I followed the instructions
given in  github.com/IBAMR/sublime-settings to configure the IBAMR with sublime.
I use Ubuntu 14.04 LTS and sublime text 3.


1. Following the instructions, I deleted the User folder which is located in:

   Sublime\ Text\ 3/Packages/

2. Then I copied the User file given in IBAMR Github to the above location.

3. I deleted the Default(OSX).sublime-keymap in the User folder and added Default(Linux).sublime-keymap as I use Ubuntu. When I restarted the sublime, the necessary packages are automatically downloaded. After that I added the project path in the sublime linter file.

4. I also copied the sublime project template from the scripts and put it in the source code directory

cd $HOME/sfw/IBAMR-Git/IBAMR
cp scripts/project_templates/sublime/ibamr.sublime-project.template ./ibamr.sublime-project

I included my project path in this file.

5. I installed the scan-build (version - 2.0.16 ) and compdb (version - 0.2.0) using python - 3.6.3. However, when I execute the setup_compile_commands.sh file which is located inside the scripts folder, I am getting the following error:

./setup_compile_commands.sh: line 74: intercept-build: command not found
./setup_compile_commands.sh: line 75: compdb: command not found

I could see that both errors are due to scan-build and compdb. Any idea to resolve this error?

I am attaching the screenshots the following screen-shots:

1. compdb_error.png - You can see the error I am getting while executing the setup_compile_commands.sh file.

2. scan-build_and_compdb_installation - you can see that the installation of scan-build and compdb are successful.


--
Regards
Ramakrishnan T.
scan-build_and_compdb_installation.png
compdb_error.png

Boyce Griffith

unread,
May 17, 2019, 8:39:17 AM5/17/19
to ibam...@googlegroups.com

On May 17, 2019, at 7:27 AM, Ramakrishnan Thirumalaisamy <thirumala...@gmail.com> wrote:

Hi,

I am Ramakrishnan and I am a student of Amneet Bhalla. I followed the instructions
given in  github.com/IBAMR/sublime-settings to configure the IBAMR with sublime.
I use Ubuntu 14.04 LTS and sublime text 3.


1. Following the instructions, I deleted the User folder which is located in:

   Sublime\ Text\ 3/Packages/

2. Then I copied the User file given in IBAMR Github to the above location.

3. I deleted the Default(OSX).sublime-keymap in the User folder and added Default(Linux).sublime-keymap as I use Ubuntu. When I restarted the sublime, the necessary packages are automatically downloaded. After that I added the project path in the sublime linter file.

4. I also copied the sublime project template from the scripts and put it in the source code directory

cd $HOME/sfw/IBAMR-Git/IBAMR
cp scripts/project_templates/sublime/ibamr.sublime-project.template ./ibamr.sublime-project

I included my project path in this file.

5. I installed the scan-build (version - 2.0.16 ) and compdb (version - 0.2.0) using python - 3.6.3. However, when I execute the setup_compile_commands.sh file which is located inside the scripts folder, I am getting the following error:

./setup_compile_commands.sh: line 74: intercept-build: command not found
./setup_compile_commands.sh: line 75: compdb: command not found

I could see that both errors are due to scan-build and compdb. Any idea to resolve this error?

You need to have scan-build (https://github.com/rizsotto/scan-build) and compdb (https://github.com/Sarcasm/compdb) to get that script to work. If those commands are not showing up in your path, then the script will not work.

FWIW:

$ which scan-build
/usr/local/miniconda3/bin/scan-build
$ which intercept-build
/usr/local/miniconda3/bin/intercept-build
$ which compdb
/usr/local/miniconda3/bin/compdb

— Boyce

PS: It is easier to read copy-and-pasted text than screenshot.

I am attaching the screenshots the following screen-shots:

1. compdb_error.png - You can see the error I am getting while executing the setup_compile_commands.sh file.

2. scan-build_and_compdb_installation - you can see that the installation of scan-build and compdb are successful.


--
Regards
Ramakrishnan T.

--
You received this message because you are subscribed to the Google Groups "IBAMR Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-dev+...@googlegroups.com.
To post to this group, send email to ibam...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibamr-dev/CAJ0QxmpVbRGAkR9OdRdNh%2Bw8DcuwU7HTzLHuqg7TPwVBTHc16g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
<scan-build_and_compdb_installation.png><compdb_error.png>

Amneet Bhalla

unread,
May 17, 2019, 10:43:15 AM5/17/19
to ibam...@googlegroups.com
IIRC Aaron had done these (intercept-built or compdb) for Linux or was it just the Bear tool for getting json file to use clang-modernize?

I think Rama ran pip install commands to get both intercept-built and compdb, but they don’t show up in the path.

Rama, can you list the exact steps you performed to get them both?

(Perhaps building these tools from scratch  is easy enough to avoid pip install hassle)



For more options, visit https://groups.google.com/d/optout.
--
--Amneet 



Boyce Griffith

unread,
May 17, 2019, 10:43:23 AM5/17/19
to ibam...@googlegroups.com

On May 17, 2019, at 8:39 AM, Boyce Griffith <boy...@gmail.com> wrote:


On May 17, 2019, at 7:27 AM, Ramakrishnan Thirumalaisamy <thirumala...@gmail.com> wrote:

Hi,

I am Ramakrishnan and I am a student of Amneet Bhalla. I followed the instructions
given in  github.com/IBAMR/sublime-settings to configure the IBAMR with sublime.
I use Ubuntu 14.04 LTS and sublime text 3.


1. Following the instructions, I deleted the User folder which is located in:

   Sublime\ Text\ 3/Packages/

2. Then I copied the User file given in IBAMR Github to the above location.

3. I deleted the Default(OSX).sublime-keymap in the User folder and added Default(Linux).sublime-keymap as I use Ubuntu. When I restarted the sublime, the necessary packages are automatically downloaded. After that I added the project path in the sublime linter file.

It would be good to know if those two keymaps can co-exist in the same directory.

Boyce Griffith

unread,
May 17, 2019, 10:47:38 AM5/17/19
to ibam...@googlegroups.com

On May 17, 2019, at 10:43 AM, Amneet Bhalla <mail2...@gmail.com> wrote:

IIRC Aaron had done these (intercept-built or compdb) for Linux or was it just the Bear tool for getting json file to use clang-modernize?

Yes. BEAR does not work as well on MacOS.

I think Rama ran pip install commands to get both intercept-built and compdb, but they don’t show up in the path.

Wherever pip is installing stuff needs to be in your PATH.

You can get some information about this by running

$ pip show compdb
Name: compdb
Version: 0.2.0
Summary: The compilation database Swiss army knife
Author: Guillaume Papin
License: MIT
Location: /usr/local/miniconda3/lib/python3.6/site-packages
Requires: 
Required-by: 

The actual script is in /usr/local/miniconda3/bin — that is the directory that needs to go into the PATH.

I see that I had to add this directory manually to my .bashrc file:

# miniconda settings
export PATH=/usr/local/miniconda3/bin:"$PATH"
 
Rama, can you list the exact steps you performed to get them both?

(Perhaps building these tools from scratch  is easy enough to avoid pip install hassle)

There should be no hassle if the PATH is setup to correspond to wherever pip is dumping stuff.

Boyce Griffith

unread,
May 17, 2019, 10:50:12 AM5/17/19
to ibam...@googlegroups.com

Amneet Bhalla

unread,
May 17, 2019, 10:55:36 AM5/17/19
to ibam...@googlegroups.com
On Fri, May 17, 2019 at 7:47 AM Boyce Griffith <boy...@gmail.com> wrote:


On May 17, 2019, at 10:43 AM, Amneet Bhalla <mail2...@gmail.com> wrote:

IIRC Aaron had done these (intercept-built or compdb) for Linux or was it just the Bear tool for getting json file to use clang-modernize?

Yes. BEAR does not work as well on MacOS.

Hmm, hence compdb and scan-build etc? I was trying BEAR on OSX few years back to make atom work. I recall getting a json file out of it but don’t recall if atom worked with it.

I think Rama ran pip install commands to get both intercept-built and compdb, but they don’t show up in the path.

Wherever pip is installing stuff needs to be in your PATH.

You can get some information about this by running

Ah, that’s the magic to know the path from pip. 

Is it OK, to alias python to python3 on shell or in bashrc? If we don’t do this python 2 is used by the shell. Is that how you also select python3 instead of 2?

For more options, visit https://groups.google.com/d/optout.
--
--Amneet 



Amneet Bhalla

unread,
May 17, 2019, 11:02:02 AM5/17/19
to ibam...@googlegroups.com
Rama I see in the screenshot that you are using python4 to get pip to install scan-build. On the next line it says using pip from python3.

Can you stick to python3 for everything or there is something not working with it?
--
--Amneet 



Boyce Griffith

unread,
May 17, 2019, 11:02:06 AM5/17/19
to ibam...@googlegroups.com

On May 17, 2019, at 10:55 AM, Amneet Bhalla <mail2...@gmail.com> wrote:



On Fri, May 17, 2019 at 7:47 AM Boyce Griffith <boy...@gmail.com> wrote:


On May 17, 2019, at 10:43 AM, Amneet Bhalla <mail2...@gmail.com> wrote:

IIRC Aaron had done these (intercept-built or compdb) for Linux or was it just the Bear tool for getting json file to use clang-modernize?

Yes. BEAR does not work as well on MacOS.

Hmm, hence compdb and scan-build etc? I was trying BEAR on OSX few years back to make atom work. I recall getting a json file out of it but don’t recall if atom worked with it.


I think Rama ran pip install commands to get both intercept-built and compdb, but they don’t show up in the path.

Wherever pip is installing stuff needs to be in your PATH.

You can get some information about this by running

Ah, that’s the magic to know the path from pip. 

Is it OK, to alias python to python3 on shell or in bashrc? If we don’t do this python 2 is used by the shell. Is that how you also select python3 instead of 2?

Boyce Griffith

unread,
May 17, 2019, 11:03:58 AM5/17/19
to ibam...@googlegroups.com

On May 17, 2019, at 11:01 AM, Amneet Bhalla <mail2...@gmail.com> wrote:

Rama I see in the screenshot that you are using python4 to get pip to install scan-build. On the next line it says using pip from python3.

Can you stick to python3 for everything or there is something not working with it?

There also is pip vs. pip3. I do not know whether it makes a difference in setting things up to use the right python.

Ramakrishnan Thirumalaisamy

unread,
May 20, 2019, 1:11:12 PM5/20/19
to ibam...@googlegroups.com

Thank you for the suggestions.

I installed python - 3.6.3 and created the symlink named python4 to it.

I used the following commands to install compdb and scan-build:

python4 -m pip install scan-build
python4 -m pip install compdb

These packages are installed in the user local directory:

/home/amaresh/.local/lib/python3.6/site-packages

But I did not add this path to my .bashrc file. That is why I was getting the error message as compdb and scan-build are not found. Following Boyce suggestion, I added the following path in my .bashrc file:

export PATH=/home/amaresh/.local/bin:$PATH

Now that error is resolved. I have a working IBAMR directory.

Now if I run  ./setup_compile_command.sh, it shows up the following error:


/home/amaresh/sfw/petsc/3.10.0/include/petscsys.h:165:6: error: #error "PETSc was configured with OpenMPI but now appears to be compiling using a non-OpenMPI mpi.h"
 #    error "PETSc was configured with OpenMPI but now appears to be compiling using a non-OpenMPI mpi.h"

      ^~~~~
In file included from /home/amaresh/sfw/linux/boost/1.67.0/include/boost/concept_check.hpp:27,

                 from /home/amaresh/sfw/linux/boost/1.67.0/include/boost/multi_array/concept_checks.hpp:21,
                 from /home/amaresh/sfw/linux/boost/1.67.0/include/boost/multi_array/base.hpp:28,
                 from /home/amaresh/sfw/linux/boost/1.67.0/include/boost/multi_array.hpp:26,
                 from ../../../IBAMR/ibtk/lib/../src/lagrangian/LData.cpp:40:
/home/amaresh/sfw/linux/boost/1.67.0/include/boost/mpl/assert.hpp:188:21: warning: unnecessary parentheses in declaration of ‘assert_arg’ [-Wparentheses]
 failed ************ (Pred::************
                     ^
/home/amaresh/sfw/linux/boost/1.67.0/include/boost/mpl/assert.hpp:193:21: warning: unnecessary parentheses in declaration of ‘assert_not_arg’ [-Wparentheses]
 failed ************ (boost::mpl::not_<Pred>::************
                     ^
make[2]: *** [../src/lagrangian/libIBTK2d_a-LData.o] Error 1
make[2]: Leaving directory `/home/amaresh/sfw/IBAMR-Git/objs-dbg/ibtk/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/amaresh/sfw/IBAMR-Git/objs-dbg/ibtk'
make: *** [all-recursive] Error 1
WARNING:compdb.includedb:/home/amaresh/sfw/samrai/2.4.4/linux-g++-debug/include/tbox/SAMRAI_MPI.h: could not resolve header: "mpi.h"
ln: failed to create symbolic link ‘/home/amaresh/sfw/IBAMR-Git/IBAMR/compile_commands.json’: File exists



I also built the IBAMR code (in debug mode) from scratch in another workstation. There also I get the following error when I run the script:


/home/raam/sfw/samrai/2.4.4/linux-g++-debug/include/tbox/SAMRAI_MPI.h:33:10: fatal error: mpi.h: No such file or directory
 #include "mpi.h"

          ^~~~~~~
compilation terminated.
Makefile:3098: recipe for target '../src/boundary/libIBTK2d_a-HierarchyGhostCellInterpolation.o' failed
make[2]: *** [../src/boundary/libIBTK2d_a-HierarchyGhostCellInterpolation.o] Error 1
make[2]: Leaving directory '/home/raam/sfw/ibamr/objs-dbg/ibtk/lib'
Makefile:614: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/raam/sfw/ibamr/objs-dbg/ibtk'
Makefile:612: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
WARNING:compdb.includedb:/home/raam/sfw/samrai/2.4.4/linux-g++-debug/include/tbox/SAMRAI_MPI.h: could not resolve header: "mpi.h"
ln: failed to create symbolic link '/home/raam/sfw/ibamr/IBAMR/compile_commands.json': File exists


The IBAMR directory is a working directory in both the machines. Only when we run the script (setup_compile_commands), we end up getting these errors.
Could you give us some idea to resolve this?


Regards
Ramakrishnan T.









For more options, visit https://groups.google.com/d/optout.


--
Regards
Ramakrishnan T.

Boyce Griffith

unread,
May 20, 2019, 1:26:15 PM5/20/19
to IBAMR Developers

On May 20, 2019, at 1:09 PM, Ramakrishnan Thirumalaisamy <thirumala...@gmail.com> wrote:


Thank you for the suggestions.

I installed python - 3.6.3 and created the symlink named python4 to it.

This sounds like a very bad idea to me. python4 should correspond to Python 4. (Does Python 4 even exist yet?)

I used the following commands to install compdb and scan-build:

python4 -m pip install scan-build
python4 -m pip install compdb

These packages are installed in the user local directory:

/home/amaresh/.local/lib/python3.6/site-packages

But I did not add this path to my .bashrc file. That is why I was getting the error message as compdb and scan-build are not found. Following Boyce suggestion, I added the following path in my .bashrc file:

export PATH=/home/amaresh/.local/bin:$PATH

Now that error is resolved. I have a working IBAMR directory.

Note that the above is independent of IBAMR.

Now if I run  ./setup_compile_command.sh, it shows up the following error:

You are going to figure out where the other MPI is coming from in your PATH. You need to ensure that consistent MPIs are being used.

/home/amaresh/sfw/petsc/3.10.0/include/petscsys.h:165:6: error: #error "PETSc was configured with OpenMPI but now appears to be compiling using a non-OpenMPI mpi.h"
 #    error "PETSc was configured with OpenMPI but now appears to be compiling using a non-OpenMPI mpi.h"

      ^~~~~
In file included from /home/amaresh/sfw/linux/boost/1.67.0/include/boost/concept_check.hpp:27,

                 from /home/amaresh/sfw/linux/boost/1.67.0/include/boost/multi_array/concept_checks.hpp:21,
                 from /home/amaresh/sfw/linux/boost/1.67.0/include/boost/multi_array/base.hpp:28,
                 from /home/amaresh/sfw/linux/boost/1.67.0/include/boost/multi_array.hpp:26,
                 from ../../../IBAMR/ibtk/lib/../src/lagrangian/LData.cpp:40:
/home/amaresh/sfw/linux/boost/1.67.0/include/boost/mpl/assert.hpp:188:21: warning: unnecessary parentheses in declaration of ‘assert_arg’ [-Wparentheses]
 failed ************ (Pred::************
                     ^
/home/amaresh/sfw/linux/boost/1.67.0/include/boost/mpl/assert.hpp:193:21: warning: unnecessary parentheses in declaration of ‘assert_not_arg’ [-Wparentheses]
 failed ************ (boost::mpl::not_<Pred>::************
                     ^
make[2]: *** [../src/lagrangian/libIBTK2d_a-LData.o] Error 1
make[2]: Leaving directory `/home/amaresh/sfw/IBAMR-Git/objs-dbg/ibtk/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/amaresh/sfw/IBAMR-Git/objs-dbg/ibtk'
make: *** [all-recursive] Error 1
WARNING:compdb.includedb:/home/amaresh/sfw/samrai/2.4.4/linux-g++-debug/include/tbox/SAMRAI_MPI.h: could not resolve header: "mpi.h"
ln: failed to create symbolic link ‘/home/amaresh/sfw/IBAMR-Git/IBAMR/compile_commands.json’: File exists

This is just a warning. This is not a very sophisticated script. You will need to put this file in the root project directory (either copy or link) after it is created.

I also built the IBAMR code (in debug mode) from scratch in another workstation. There also I get the following error when I run the script:


/home/raam/sfw/samrai/2.4.4/linux-g++-debug/include/tbox/SAMRAI_MPI.h:33:10: fatal error: mpi.h: No such file or directory
 #include "mpi.h"

          ^~~~~~~

Make sure you use consistent MPI compilers.

compilation terminated.
Makefile:3098: recipe for target '../src/boundary/libIBTK2d_a-HierarchyGhostCellInterpolation.o' failed
make[2]: *** [../src/boundary/libIBTK2d_a-HierarchyGhostCellInterpolation.o] Error 1
make[2]: Leaving directory '/home/raam/sfw/ibamr/objs-dbg/ibtk/lib'
Makefile:614: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/raam/sfw/ibamr/objs-dbg/ibtk'
Makefile:612: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
WARNING:compdb.includedb:/home/raam/sfw/samrai/2.4.4/linux-g++-debug/include/tbox/SAMRAI_MPI.h: could not resolve header: "mpi.h"
ln: failed to create symbolic link '/home/raam/sfw/ibamr/IBAMR/compile_commands.json': File exists


The IBAMR directory is a working directory in both the machines. Only when we run the script (setup_compile_commands), we end up getting these errors.
Could you give us some idea to resolve this?

setup_compile_commands.sh re-runs make with different settings. You may need to rebuild again after running intercept-build. You can make the script do this automatically by setting REBUILD_LIBRARIES=1 in the script. (Again, this script is not very sophisticated.)

Amneet Bhalla

unread,
May 20, 2019, 2:00:59 PM5/20/19
to IBAMR Developers


/home/raam/sfw/samrai/2.4.4/linux-g++-debug/include/tbox/SAMRAI_MPI.h:33:10: fatal error: mpi.h: No such file or directory
 #include "mpi.h"

          ^~~~~~~

Make sure you use consistent MPI compilers.

Do you mean in building IBAMR and other libraries or to do something special to ensure MPI consistency for this script? I think Rama is already using consistent MPI compilers to build IBAMR. Is it possible for you guys to run this script on a linux system? You may be able to replicate the same error on a linux system.


 

For more options, visit https://groups.google.com/d/optout.


--
--Amneet 



Boyce Griffith

unread,
May 20, 2019, 2:16:58 PM5/20/19
to IBAMR Developers

On May 20, 2019, at 2:00 PM, Amneet Bhalla <mail2...@gmail.com> wrote:




/home/raam/sfw/samrai/2.4.4/linux-g++-debug/include/tbox/SAMRAI_MPI.h:33:10: fatal error: mpi.h: No such file or directory
 #include "mpi.h"

          ^~~~~~~

Make sure you use consistent MPI compilers.

Do you mean in building IBAMR and other libraries or to do something special to ensure MPI consistency for this script? I think Rama is already using consistent MPI compilers to build IBAMR. Is it possible for you guys to run this script on a linux system? You may be able to replicate the same error on a linux system.

You may need to experiment with the make command. In the script, it is:

intercept_make="make CC=intercept-cc CXX=intercept-c++ MPICH_CC=intercept-cc MPICH_CXX=intercept-cxx OMPI_CC=intercept-cc OMPI_CXX=intercept-cxx"

This replaces CC/CXX with intercept-cc/intercept-cxx, which captures stuff. The way this is supposed to work is that if you are using MPICH or OpenMPI mpicc/mpicxx, then it just swaps out the compiler command but still uses the wrapper to set the include paths.

You could try using simply:

intercept_make="make MPICH_CC=intercept-cc MPICH_CXX=intercept-cxx OMPI_CC=intercept-cc OMPI_CXX=intercept-cxx"

Amneet Bhalla

unread,
May 20, 2019, 2:20:40 PM5/20/19
to IBAMR Developers
You could try using simply:

intercept_make="make MPICH_CC=intercept-cc MPICH_CXX=intercept-cxx OMPI_CC=intercept-cc OMPI_CXX=intercept-cxx"


I see. We tried removing MPICH_CC and MPICH_CXX from this command but kept CC, CXX, OMPI_CC, and OMPI_CXX thinking that MPICH maybe interfering with OMPI. Rama can you give this a try?


For more options, visit https://groups.google.com/d/optout.


--
--Amneet 



Ramakrishnan Thirumalaisamy

unread,
May 20, 2019, 2:24:34 PM5/20/19
to ibam...@googlegroups.com
In ubuntu 14.04, there are already two versions of python: one is python2.7 and the other one is python3.4. python symlink refers to python2.7 and python3.4 symlink refers to python3.4. Hence, I created a new symlink which is nowhere used except to download the compdb and scan-build packages.

I will give a try now by removing the "CC=intercept-cc CXX=intercept-c++" from the intercept make.


For more options, visit https://groups.google.com/d/optout.


--
Regards
Ramakrishnan T.

Ramakrishnan Thirumalaisamy

unread,
May 20, 2019, 2:27:26 PM5/20/19
to ibam...@googlegroups.com
Sorry, There is a correction in my previous reply: python3 symlink refers to python3.4
--
Regards
Ramakrishnan T.

Boyce Griffith

unread,
May 20, 2019, 3:45:42 PM5/20/19
to IBAMR Developers

On May 20, 2019, at 2:21 PM, Ramakrishnan Thirumalaisamy <thirumala...@gmail.com> wrote:

In ubuntu 14.04, there are already two versions of python: one is python2.7 and the other one is python3.4. python symlink refers to python2.7 and python3.4 symlink refers to python3.4. Hence, I created a new symlink which is nowhere used except to download the compdb and scan-build packages.

OK, but calling it python4 seems like something that may cause problems at some later point.

Also, can you just use python3.4?

Amneet Bhalla

unread,
May 20, 2019, 4:00:19 PM5/20/19
to IBAMR Developers
I agree naming it python4 is shooting in the foot :-/

(I think he had to use python3.7 to get these scripts from Ubuntu repositories. His python4 is referring to python3.7)


For more options, visit https://groups.google.com/d/optout.


--
--Amneet 



Reply all
Reply to author
Forward
0 new messages