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

caf script fails to link against shared-library client code #635

Closed
rouson opened this issue Feb 16, 2019 · 1 comment
Closed

caf script fails to link against shared-library client code #635

rouson opened this issue Feb 16, 2019 · 1 comment
Assignees

Comments

@rouson
Copy link
Member

rouson commented Feb 16, 2019

Avg response time
Issue Stats

Please make sure to put any logs, terminal output, or code in
[fenced code blocks]. Please also read the [contributing guidelines]
before submitting a new issue.

Defect/Bug Report

Building json-fortran fails to link unless the OpenCoarrays caf script is modified to link against libcaf_mpi.so instead of libcaf_mpi.a.

  • OpenCoarrays Version: 2.4.0-8-g7aafb20
  • Fortran Compiler: gfortran 9.0.1
  • C compiler used for building lib:gcc 9.0.1
  • Installation method: install.sh
  • Output of uname -a: Linux Sourcery-Institute-VM 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • MPI library being used: MPICH 3.2
  • Machine architecture and number of physical cores: macBook Pro with 4-core 2.7 GHz Intel core i7
  • Version of CMake: 3.12.3

Observed Behavior

[  8%] Linking Fortran shared library lib/libjsonfortran.so
/usr/bin/ld: /home/rouson/Desktop/Builds/opt/opencoarrays/2.3.1-7aafb2/gnu/9.0.1/lib/libcaf_mpi.a(mpi_caf.c.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Error: comand:
   `/home/rouson/Builds/opt/gnu/9.0.1/bin/gfortran -I/home/rouson/Desktop/Builds/opt/opencoarrays/2.3.1-7aafb2/gnu/9.0.1/include/OpenCoarrays-2.4.0-8-g7aafb20_GNU-9.0.1 -fcoarray=lib -Wl,-rpath -Wl,/home/rouson/Builds/opt/mpich/3.2/gnu/9.0.0/lib -Wl,--enable-new-dtags -L/home/rouson/Desktop/Builds/opt/mpich/3.2/gnu/9.0.0/lib -fPIC -fbacktrace -fno-omit-frame-pointer -O3 -DNDEBUG -O3 -shared -Wl,-soname,libjsonfortran.so.6.10 -o lib/libjsonfortran.so.6.10.0 CMakeFiles/jsonfortran.dir/src/json_kinds.F90.o CMakeFiles/jsonfortran.dir/src/json_parameters.F90.o CMakeFiles/jsonfortran.dir/src/json_string_utilities.F90.o CMakeFiles/jsonfortran.dir/src/json_value_module.F90.o CMakeFiles/jsonfortran.dir/src/json_file_module.F90.o CMakeFiles/jsonfortran.dir/src/json_module.F90.o /home/rouson/Desktop/Builds/opt/opencoarrays/2.3.1-7aafb2/gnu/9.0.1/lib/libcaf_mpi.a /home/rouson/Builds/opt/mpich/3.2/gnu/9.0.0/lib/libmpifort.so /home/rouson/Builds/opt/mpich/3.2/gnu/9.0.0/lib/libmpi.so`
failed to compile.
CMakeFiles/jsonfortran.dir/build.make:158: recipe for target 'lib/libjsonfortran.so.6.10.0' failed
make[6]: *** [lib/libjsonfortran.so.6.10.0] Error 1
CMakeFiles/Makefile2:523: recipe for target 'CMakeFiles/jsonfortran.dir/all' failed
make[5]: *** [CMakeFiles/jsonfortran.dir/all] Error 2
CMakeFiles/Makefile2:705: recipe for target 'CMakeFiles/build_tests.dir/rule' failed
make[4]: *** [CMakeFiles/build_tests.dir/rule] Error 2
Makefile:396: recipe for target 'build_tests' failed
make[3]: *** [build_tests] Error 2
CMakeFiles/json-fortran.dir/build.make:112: recipe for target 'TPLs/Stamp/json-fortran/json-fortran-build' failed
make[2]: *** [TPLs/Stamp/json-fortran/json-fortran-build] Error 2
CMakeFiles/Makefile2:147: recipe for target 'CMakeFiles/json-fortran.dir/all' failed
make[1]: *** [CMakeFiles/json-fortran.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Expected Behavior

Successful build of json-fortran.

Workaround

  1. Replace libcaf_mpi.a with libcaf_mpi.soin the installedcaf` script.
  2. Append the installed OpenCoarrays lib directory to the LD_LIBRARY_PATH.
@zbeekman
Copy link
Collaborator

Fixed in #639 and release 2.5.0

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

2 participants