Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should inherit compile information from NGSolve project? #1

Open
stefanozampini opened this issue Aug 3, 2020 · 0 comments
Open

Should inherit compile information from NGSolve project? #1

stefanozampini opened this issue Aug 3, 2020 · 0 comments

Comments

@stefanozampini
Copy link
Collaborator

Just tried a build, with an NGSolve successfully built and compiled using -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx

Then, when configuring and building the interface,

kl-18448:build szampini$ cmake .. -DPETSC_EXECUTABLE_RUNS=YES 
-- The C compiler identification is AppleClang 10.0.1.10010046
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- Check for working C compiler: /usr/local/opt/ccache/libexec/cc
-- Check for working C compiler: /usr/local/opt/ccache/libexec/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/opt/ccache/libexec/c++
-- Check for working CXX compiler: /usr/local/opt/ccache/libexec/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Netgen: /Users/szampini/Devel/ngsolve/install/Contents/Resources/CMake
-- petsc_lib_dir /Users/szampini/Devel/petsc/arch-debug/lib
-- Recognized PETSc install with single library for all packages
-- Performing Test MULTIPASS_TEST_1_petsc_works_minimal
-- Performing Test MULTIPASS_TEST_1_petsc_works_minimal - Failed
-- Performing Test MULTIPASS_TEST_2_petsc_works_allincludes
-- Performing Test MULTIPASS_TEST_2_petsc_works_allincludes - Success
-- PETSc requires extra include paths, but links correctly with only interface libraries.  This is an unexpected configuration (but it seems to work fine).
 XXXXXXXXXXX inc needed /Users/szampini/Devel/petsc/include;/Users/szampini/Devel/petsc/arch-debug/include;/Users/szampini/Devel/petsc-pkgs/include;/opt/X11/include;/usr/local/include;/usr/local/opt/zlib/include;/Users/szampini/local/include;/usr/X11/include
 INCLUDES:  /Users/szampini/Devel/petsc/include;/Users/szampini/Devel/petsc/arch-debug/include;/Users/szampini/Devel/petsc-pkgs/include;/opt/X11/include;/usr/local/include;/usr/local/opt/zlib/include;/Users/szampini/local/include;/usr/X11/include
-- Found PETSc: /Users/szampini/Devel/petsc/include;/Users/szampini/Devel/petsc/arch-debug/include;/Users/szampini/Devel/petsc-pkgs/include;/opt/X11/include;/usr/local/include;/usr/local/opt/zlib/include;/Users/szampini/local/include;/usr/X11/include (found version "3.13.4.99") 
-- Compiling the Real PETSc interface!
-- Setting build type to NGSolve build type: RelWithDebInfo
-- Found PythonInterp: /usr/local/bin/python3 (found suitable version "3.8.5", minimum required is "3") 
-- Found PythonLibs: /usr/local/Frameworks/Python.framework/Versions/3.8/lib/libpython3.8.dylib (found suitable version "3.8.5", minimum required is "3") 
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/szampini/Devel/ngs-petsc/build
kl-18448:build szampini$ make -j6
Scanning dependencies of target libpetscinterface
[ 28%] Building CXX object src/CMakeFiles/libpetscinterface.dir/python_ngspetsc.cpp.o
[ 28%] Building CXX object src/CMakeFiles/libpetscinterface.dir/petsc_linalg.cpp.o
[ 42%] Building CXX object src/CMakeFiles/libpetscinterface.dir/utils.cpp.o
[ 71%] Building CXX object src/CMakeFiles/libpetscinterface.dir/petsc_pc.cpp.o
[ 71%] Building CXX object src/CMakeFiles/libpetscinterface.dir/petsc_snes.cpp.o
[ 85%] Building CXX object src/CMakeFiles/libpetscinterface.dir/petsc_ksp.cpp.o
[100%] Linking CXX shared library libpetscinterface.so
Undefined symbols for architecture x86_64:
  "_MPI_Allreduce", referenced from:
      ngs_petsc_interface::NGs2PETScVecMap::NGs2PETScVecMap(unsigned long, int, std::__1::shared_ptr<ngla::ParallelDofs>, std::__1::shared_ptr<ngcore::BitArray>) in petsc_linalg.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/libpetscinterface.so] Error 1
make[1]: *** [src/CMakeFiles/libpetscinterface.dir/all] Error 2
make: *** [all] Error 2

I get it working by specifying again the MPI compiler wrappers to the interface configure. However, since the interface depends on NGSolve, I think it should get compiler information from NGSolve itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant