GridOPTICS / GridPACK

https://www.gridpack.org/
47 stars 22 forks source link

building python wrapper for the develop branch #179

Closed huangrenke closed 1 year ago

huangrenke commented 1 year ago

Hi,

For the purpose of testing the hadrec model for the develop branch , when I trying to build the python wrapper for the develop branch, I encountered the following error during the building using the following command (GridPACK has already been successfully built and installed):

python setup.py build

Any suggestions for this? Thank you very much!

-- Performing Test HAS_FLTO -- Performing Test HAS_FLTO - Success -- LTO enabled -- Configuring done -- Generating done -- Build files have been written to: /home/fwtop/hadrec/gridpack-dev/python/build/temp.linux-x86_64-3.6 [ 0%] Built target parallel_scripts [ 50%] Building CXX object src/CMakeFiles/gridpack.dir/gridpack.cpp.o In file included from /home/fwtop/hadrec/gridpack-dev/python/src/gridpack.cpp:21: /home/fwtop/hadrec/gridpack-dev/src/install/include/gridpack/environment/environment.hpp:24:10: fatal error: boost/mpi.hpp: No such file or directory 24 | #include <boost/mpi.hpp> | ^~~~~~~ compilation terminated. gmake[2]: [src/CMakeFiles/gridpack.dir/gridpack.cpp.o] Error 1 gmake[1]: [src/CMakeFiles/gridpack.dir/all] Error 2 gmake: * [all] Error 2 Traceback (most recent call last): File "setup.py", line 72, in tests_require=['nose'], File "/home/fwtop/anaconda3/envs/py3test/lib/python3.6/site-packages/setuptools/init.py", line 153, in setup return distutils.core.setup(attrs) File "/home/fwtop/anaconda3/envs/py3test/lib/python3.6/distutils/core.py", line 148, in setup dist.run_commands() File "/home/fwtop/anaconda3/envs/py3test/lib/python3.6/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/home/fwtop/anaconda3/envs/py3test/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/fwtop/anaconda3/envs/py3test/lib/python3.6/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/home/fwtop/anaconda3/envs/py3test/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/fwtop/anaconda3/envs/py3test/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "setup.py", line 37, in run self.build_extension(ext) File "setup.py", line 56, in build_extension subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp) File "/home/fwtop/anaconda3/envs/py3test/lib/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j2']' returned non-zero exit status 2.

wperkins commented 1 year ago

@huangrenke, edit src/lib/GridPACK.cmake and uncomment these lines:

  list(APPEND gp_include 
    @Boost_INCLUDE_DIR@
    @MPI_INCLUDE_PATH@
  )

  list(APPEND gp_libs
    @Boost_LIBRARIES@
    @MPI_CXX_LIBRARIES@
  )

and run make install again. This should be fixed when #119 is merged or maybe sooner.

wperkins commented 1 year ago

This should be fixed now. Reopen if not.