flang-compiler / flang

Flang is a Fortran language front-end designed for integration with LLVM.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flang runtime depends on libomp but does not link it with `-rpath`

bryanpkc opened this issue · comments

libflang.so and libflangrti.so contain references to libomp.so symbols but, when the driver is invoked without -fopenmp, the linker does not attempt to link a user program with the OpenMP runtime. In the absence of LD_RUN_PATH or LD_LIBRARY_PATH, building any user program without -fopenmp results in linker errors like the ones below:

/usr/bin/ld: warning: libomp.so, needed by /home2/b00375952/src/install.release_13x/bin/../lib/libflang.so, not found (try using -rpath or -rpath-link)
/home2/b00375952/src/install.release_13x/bin/../lib/libflang.so: undefined reference to `omp_set_dynamic@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflang.so: undefined reference to `omp_set_num_threads@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflang.so: undefined reference to `omp_get_schedule@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflang.so: undefined reference to `omp_set_max_active_levels@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflang.so: undefined reference to `omp_get_ancestor_thread_num@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflang.so: undefined reference to `omp_set_nested@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflang.so: undefined reference to `omp_get_team_size@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflangrti.so: undefined reference to `__kmpc_threadprivate@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflangrti.so: undefined reference to `omp_init_nest_lock@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflangrti.so: undefined reference to `__kmpc_barrier@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflangrti.so: undefined reference to `omp_unset_nest_lock@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflangrti.so: undefined reference to `__kmpc_end_critical@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflangrti.so: undefined reference to `__kmpc_critical@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflangrti.so: undefined reference to `__kmpc_global_thread_num@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflangrti.so: undefined reference to `__kmpc_threadprivate_cached@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflang.so: undefined reference to `omp_set_schedule@VERSION'
/home2/b00375952/src/install.release_13x/bin/../lib/libflangrti.so: undefined reference to `omp_set_nest_lock@VERSION'