Skip to content

Compilation issues on a personal machine #13

@AxelDora

Description

@AxelDora

Describe the bug

Compiling the code on a personal machine returns an error in the code that seems to be linked to how the libraries being used are linked by cmake

Expected Result
Compilation

Actual Result

cmake ../channelflow/
-- 
-- configuring channelflow version 2.0.2
-- Using GNU compiler options
-- 
-- Starting system introspection
-- Found FFTW 
-- FFTW_LIBRARY=/usr/local/lib/x86_64-linux-gnu/libfftw3.so
-- FFTW_OMP_LIBRARY=/usr/local/lib/x86_64-linux-gnu/libfftw3_omp.so
-- FFTW_MPI_LIBRARY=/usr/local/lib/x86_64-linux-gnu/libfftw3_mpi.a
-- MPI libs: 
-- FFTW_MPI library: /usr/local/lib/x86_64-linux-gnu/libfftw3_mpi.a
-- NetCDF include dir: /usr/include
-- 
-- Include directories: 
-- Git revision e702ced2706262a5d04f7cfcc47989af9d7d0ed1


   ###############################################
   ###########  Configuration summary  ###########
   ###############################################
   Compiler:                       GNU 7.3.0
   Build type:                     Release
   Install prefix:                 /usr/local
   Building shared library:        yes
   Linking programs to:            shared library

   Libraries
   MPI:                            enabled
   netcdf (default file format):   enabled
   Parallel netcdf:                disabled
   HDF5 C++ (legacy file format):  disabled

   Channelflow components
   nsolver:                        enabled
   Python wrapper:                 disabled
   GTest unit testing:             enabled


-- Configuring done
-- Generating done
-- Build files have been written to: /home/aksh/GITCLONED/build
aksh@aksh-LENOVO-Y50:~/GITCLONED/build$ make -j8
[  3%] Built target gmock
[  6%] Built target gmock_main
[  8%] Built target gtest
[  9%] Built target gtest_main
[ 18%] Built target nsolver
[ 19%] Linking CXX shared library libchflow.so
/usr/bin/x86_64-linux-gnu-ld: /usr/local/lib/x86_64-linux-gnu/libfftw3_mpi.a(api.o): relocation R_X86_64_PC32 against symbol `ompi_mpi_comm_null' can not be used when making a shared object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
channelflow/CMakeFiles/chflow.dir/build.make:646: recipe for target 'channelflow/libchflow.so' failed
make[2]: *** [channelflow/libchflow.so] Error 1
CMakeFiles/Makefile2:384: recipe for target 'channelflow/CMakeFiles/chflow.dir/all' failed
make[1]: *** [channelflow/CMakeFiles/chflow.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

Information on your system
Running on Ubuntu 18.04.1 LTS
2. (CMake configuration: 3.10.2-1ubuntu2)

Running on a 2015 Lenovo Y50-70

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions