Greg,
Thank you for responding to me posting. I'm rather new to the
Eclipse IDE and as far as I understand I'm using a managed
project, so how do I add -fopenmp to the linker toolchain? But
that begs the question, how is it that -fopenmp is not getting
passed to the linker step when it does appear in the output in my
original note?
Sam Dupree
On November/26/2018 20:31:30, Greg
Watson wrote:
Hi Sam,
It looks like gfortran is not linking the OMP
runtime library into the executable. It looks like the -fopenmp
option is needed for the link step but it is not being added. If
you're using a managed project then you should add this to the
linker toolchain. If it's a makefile project, then add it to the
linker link in the Makefile.
Regards,
Greg
I've installed Eclipse PTP Version: 2018-09
(4.9.0), Build id: 20180917-1800 on a Mac Pro (Late
2013, desktop) running Mac OS X ver. 10.12.6 (Sierra).
I've been able to figure out how to set most of the
compiler options needed to run gfortran from within
Eclipse. I'm attempting to run a simple example that
uses OpenMP. See the file hello_openmp.f90 attached to
this file.
The problem I'm having is how to resolve the
unresolved references as indicted below.
02:30:33
**** Build of configuration Release for project
Hello_OpenMP ****
make all
Building file:
../src/hello_openmp.f90
Using built-in specs.
Invoking: GNU Fortran Compiler
/usr/local/bin/gfortran
-funderscoring
-I/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/
-I/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/include
-I/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/finclude
-O3 -Wall -c -fmessage-length=0 -fopenmp -v -o
"src/hello_openmp.o" "../src/hello_openmp.f90"
COLLECT_GCC=/usr/local/bin/gfortran
Target: x86_64-apple-darwin16.7.0
Configured with: ../configure
--build=x86_64-apple-darwin16.7.0
--prefix=/usr/local/Cellar/gcc/8.2.0
--libdir=/usr/local/Cellar/gcc/8.2.0/lib/gcc/8
--enable-languages=c,c++,objc,obj-c++,fortran
--program-suffix=-8 --with-gmp=/usr/local/opt/gmp
--with-mpfr=/usr/local/opt/mpfr
--with-mpc=/usr/local/opt/libmpc
--with-isl=/usr/local/opt/isl --with-system-zlib
--enable-checking=release
--with-pkgversion='Homebrew GCC 8.2.0'
--with-bugurl=https://github.com/Homebrew/homebrew-core/issues
--disable-nls
Thread model: posix
gcc version 8.2.0 (Homebrew GCC
8.2.0)
COLLECT_GCC_OPTIONS='-funderscoring'
'-I'
'/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/'
'-I'
'/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/include'
'-I'
'/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/finclude'
'-O3' '-Wall' '-c' '-fmessage-length=0' '-fopenmp'
'-v' '-o' 'src/hello_openmp.o'
'-mmacosx-version-min=10.12.0'
'-asm_macosx_version_min=10.12' '-mtune=core2'
/usr/local/Cellar/gcc/8.2.0/libexec/gcc/x86_64-apple-darwin16.7.0/8.2.0/f951
../src/hello_openmp.f90 -I
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/
-I
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/include
-I
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/finclude
-fPIC -quiet -dumpbase hello_openmp.f90
-mmacosx-version-min=10.12.0 -mtune=core2
-auxbase-strip src/hello_openmp.o -O3 -Wall
-version -funderscoring -fmessage-length=0
-fopenmp -fintrinsic-modules-path
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/finclude
-o
/var/folders/65/7cxpqns144q6wx5lyb7zcyh80000gq/T//ccO12HNa.s
GNU Fortran (Homebrew GCC 8.2.0)
version 8.2.0 (x86_64-apple-darwin16.7.0)
compiled by GNU C version
8.2.0, GMP version 6.1.2, MPFR version 4.0.1, MPC
version 1.1.0, isl version isl-0.20-GMP
GGC heuristics: --param
ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran2008 (Homebrew GCC
8.2.0) version 8.2.0 (x86_64-apple-darwin16.7.0)
compiled by GNU C version
8.2.0, GMP version 6.1.2, MPFR version 4.0.1, MPC
version 1.1.0, isl version isl-0.20-GMP
GGC heuristics: --param
ggc-min-expand=100 --param ggc-min-heapsize=131072
COLLECT_GCC_OPTIONS='-funderscoring'
'-I'
'/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/'
'-I'
'/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/include'
'-I'
'/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/finclude'
'-O3' '-Wall' '-c' '-fmessage-length=0' '-fopenmp'
'-v' '-o' 'src/hello_openmp.o'
'-mmacosx-version-min=10.12.0' '-mtune=core2'
as -arch x86_64 -v -I
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/
-I
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/include
-I
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/finclude
-force_cpusubtype_ALL -mmacosx-version-min=10.12
-o src/hello_openmp.o
/var/folders/65/7cxpqns144q6wx5lyb7zcyh80000gq/T//ccO12HNa.s
Apple LLVM version 9.0.0
(clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
-cc1as -triple x86_64-apple-macosx10.12.0
-filetype obj -main-file-name ccO12HNa.s
-target-cpu penryn -I
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/
-I
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/include
-I
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/finclude
-fdebug-compilation-dir
/Users/user/eclipse-workspace/Hello_OpenMP/Release
-dwarf-debug-producer Apple LLVM version 9.0.0
(clang-900.0.39.2) -I
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/
-I
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/include
-I
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/finclude
-dwarf-version=4 -mrelocation-model pic -o
src/hello_openmp.o
/var/folders/65/7cxpqns144q6wx5lyb7zcyh80000gq/T//ccO12HNa.s
COMPILER_PATH=/usr/local/Cellar/gcc/8.2.0/libexec/gcc/x86_64-apple-darwin16.7.0/8.2.0/:/usr/local/Cellar/gcc/8.2.0/libexec/gcc/x86_64-apple-darwin16.7.0/8.2.0/:/usr/local/Cellar/gcc/8.2.0/libexec/gcc/x86_64-apple-darwin16.7.0/:/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/:/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/
LIBRARY_PATH=/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/:/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/../../../
COLLECT_GCC_OPTIONS='-funderscoring'
'-I'
'/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/'
'-I'
'/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/include'
'-I'
'/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin16.7.0/8.2.0/finclude'
'-O3' '-Wall' '-c' '-fmessage-length=0' '-fopenmp'
'-v' '-o' 'src/hello_openmp.o'
'-mmacosx-version-min=10.12.0' '-mtune=core2'
Finished building:
../src/hello_openmp.f90
Building target: Hello_OpenMP
Invoking: MacOS X Fortran Linker
/usr/local/bin/gfortran -o
"Hello_OpenMP" ./src/hello_openmp.o
Undefined symbols for architecture
x86_64:
"_GOMP_parallel", referenced
from:
_MAIN__ in hello_openmp.o
"_omp_get_max_threads_",
referenced from:
_MAIN__ in hello_openmp.o
"_omp_get_num_procs_",
referenced from:
_MAIN__ in hello_openmp.o
"_omp_get_thread_num_",
referenced from:
_MAIN__._omp_fn.0 in
hello_openmp.o
_MAIN__ in hello_openmp.o
"_omp_get_wtime_", referenced
from:
_MAIN__ in hello_openmp.o
ld: symbol(s) not found for
architecture x86_64
collect2: error: ld returned 1
exit status
make: *** [Hello_OpenMP] Error 1
02:30:34 Build Failed. 2 errors, 0
warnings. (took 1s.615ms)
Any thoughts?
Sam Dupree.
<hello_openmp.f90>_______________________________________________
ptp-user mailing list
ptp-user@xxxxxxxxxxx
To change your delivery options, retrieve your password,
or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/ptp-user
_______________________________________________
ptp-user mailing list
ptp-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/ptp-user
|