[ncl-install] Trouble in Building NCL on Mac OS with Ifort andClang
Mary Haley
haley at ucar.edu
Mon Jul 10 07:37:19 MDT 2017
If I may jump in, it looks like the problem is with building "Iftran" which
is a converter used to convert some really old Iftran code to Fortran 77.
It appears that this executable is producing an error when it is used to
convert the code:
dyld: Library not loaded: @rpath/libintlc.dylib
Referenced from:
/Users/kian/Downloads/ncl_ncarg-6.4.0/ncarg2d/src/libncarg/v
aspackt/../../../.././ncarg2d/src/libncarg/Iftran/Iftran
Reason: image not found
/bin/sh: line 1: 4095 Abort trap: 6
../../../.././ncarg2d/src/libncarg/Iftran/Iftran < CodeIftran > CodeFortran
We have built NCL successfully using ifort and icc together, but we have
never tried it with ifort and clang. Is there a reason you need this
particular combination, and not gfortran and clang?
If you look at the make-output file for where it is building Iftran:
Making ./ncarg2d/src/libncarg/Iftran
ifort -O -c -o Iftran.o Iftran.f
ifort -O -o Iftran Iftran.o -L../../../.././common/src/libncarg_c
-lncarg_c -L "/opt/intel/lib" -lm -lintlc -lsvml -lifcore -lifport -liomp5
-L/usr/local/Cellar/ncarg/6.4.0/lib -L/opt/X11/lib
clang -O -I../../../.././include -I/opt/X11/include
-I/opt/X11/include/freetype2 -DSYSV -D_POSIX_SOURCE -D_XOPEN_SOURCE
-DByteSwapped -D__UNIXOS2__ -D_DARWIN_C_SOURCE -DNeedFuncProto -c -o
Fsplit.o Fsplit.c
Fsplit.c:28:1: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
main(int argc, char **argv) {
^
Fsplit.c:90:47: warning: implicitly declaring library function 'isspace'
with type 'int (int)' [-Wimplicit-function-declaration]
collecting=!(comment=(c=='c'||c=='C'))&&isspace(c);
^
there are some warnings, but nothing seems to indicate why it would fail.
However, since the error mentions "libintlc.dylib", I'm wondering if maybe
you should try removing all the extra intel libraries from the Iftran
compile line to see if it works.
Try this:
1. Cd to the directory containing the "Iftran" code (I'll use $NCARG to
represent the top level NCARG/NCL source tree):
cd $NCARG/ncarg2d/src/libncarg/Iftran
2. Edit the Makefile in this directory and remove all references to:
-lintlc -lsvml -lifcore -lifport -liomp5
3. From the same directory, try recompiling Iftran:
rm Iftran
make all
4. If Iftran gets built without errors, then see if it works by cding to
another directory that depends on it:
cd $NCARG/ncarg2d/src/libncarg/areas
make clean all
If this all seems to work, then you can start up the build again with:
cd $NCARG
make clean all install > make-output.2 2>&1 &
and let us know how it goes.
--Mary
On Sat, Jul 8, 2017 at 7:14 AM, Kian <kian-huang at qq.com> wrote:
>
> Hi Kevin,
>
> Thanks for your help. Your solution for linking X11 library has worked
> perfectly. However, the solution that aims at C to Fortran library seems to
> have problems.
>
> The whole make-output file is in the attachment. Here is one of related
> errors as following:
>
> Making ./ncarg2d/src/libncarg/conpack
> dyld: Library not loaded: @rpath/libintlc.dylib
> Referenced from: /Users/kian/Downloads/ncl_ncarg-6.4.0/ncarg2d/src/
> libncarg/conpack/../../../.././ncarg2d/src/libncarg/Iftran/Iftran
> Reason: image not found
> /bin/sh: line 1: 82922 Abort trap: 6 ../../../.././ncarg2d/src/libncarg/Iftran/Iftran
> < CodeIftran > CodeFortran
> make[5]: *** [IftranRun] Error 134
> Making ./ncarg2d/src/libncarg/conpackt
> dyld: Library not loaded: @rpath/libintlc.dylib
> Referenced from: /Users/kian/Downloads/ncl_ncarg-6.4.0/ncarg2d/src/
> libncarg/conpackt/../../../.././ncarg2d/src/libncarg/Iftran/Iftran
> Reason: image not found
> /bin/sh: line 1: 82928 Abort trap: 6 ../../../.././ncarg2d/src/libncarg/Iftran/Iftran
> < CodeIftran > CodeFortran
>
> ------------------
> Kian Huang
>
>
>
> ------------------ Original ------------------
> *From: * "Kevin Hallock";<hallock at ucar.edu>;
> *Date: * Sat, Jul 8, 2017 02:15 AM
> *To: * "Kian"<kian-huang at qq.com>;
> *Cc: * "ncl-install"<ncl-install at ucar.edu>;
> *Subject: * Re: [ncl-install] Trouble in Building NCL on Mac OS with
> Ifort andClang
>
> Hi Kian,
>
> According to one of our other developers, changing your CtoFLibraries and
> CtoFLibrariesUser definitions to something like this might fix the linking
> issue:
> #define CtoFLibraries -L "/opt/intel/lib" -lm -lintlc -lsvml -lifcore
> -lifport -liomp5
> #define CtoFLibrariesUser -L "/opt/intel/lib" -lm -lintlc -lsvml -lifcore
> -lifport
>
> I hope this helps,
> Kevin
>
> On Jul 7, 2017, at 11:20 AM, Kevin Hallock <hallock at ucar.edu> wrote:
>
> Hi Kian,
>
> “ft2build.h” is provided by XQuartz in the “/opt/X11/include/freetype2”
> directory, so you might need to add “-I/opt/X11/include/freetype2” to your
> clang command.
>
> I don’t have any experience with ifort myself, and I’m not sure why it’s
> failing to load the appropriate dynamic libraries, but I will ask some of
> the other NCL developers if they’ve experienced this behavior when using
> ifort.
>
> Kevin
>
> On Jul 7, 2017, at 1:41 AM, Kian <kian-huang at qq.com> wrote:
>
>
> Hi everyone,
>
> I am trying to build NCL on Mac OS with ifort, clang compilers and XQuartz
> library these days and I have some trouble. I have solved some of these
> problem, but still left some. Thank you for reading and hope for solutions.
>
> This is my operational system kernel information:
> Darwin Kernel Version 16.6.0
>
> The error information I met list as following:
>
> clang -O -I../../../.././include -I/opt/X11/include -DDarwin -DCTXT
> -DX11 -DPS -DPDF -DPIX -DSYSV -D_POSIX_SOURCE -D_XOPEN_SOURCE
> -DByteSwapped -D__UNIXOS2__ -D_DARWIN_C_SOURCE -DNeedFuncProto -c -o
> cro_device.o cro_device.c
> In file included from cro_device.c:26:
> In file included from ./cro.h:147:
> /opt/X11/include/cairo/cairo-ft.h:46:10: fatal error: 'ft2build.h' file
> not found
> #include <ft2build.h>
> ^
> 1 error generated.
> make[5]: *** [cro_device.o] Error 1
>
>
> Previously, I met another problem. Log file (make-output) showed that the
> compiler can not load the ifort dynamic libraries. I solved it by using
> static linking by setting
>
> #define CtoFLibraries /opt/intel/lib/libifcore.a
> /opt/intel/lib/libsvml.a /opt/intel/lib/libimf.a /opt/intel/lib/libirc.a
> /opt/intel/lib/libiomp5.a
> #define CtoFLibrariesUser /opt/intel/lib/libifcore.a
> /opt/intel/lib/libsvml.a /opt/intel/lib/libimf.a /opt/intel/lib/libirc.a
> /opt/intel/lib/libiomp5.a
>
> But it was invalid for ifort -openmp option (Maybe change makefile setting
> will solve that. I have not tried it yet).
> ------------------
> Kian Huang
>
> _______________________________________________
> ncl-install mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-install
>
>
>
>
> _______________________________________________
> ncl-install mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-install
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-install/attachments/20170710/644600df/attachment.html
More information about the ncl-install
mailing list