[ncl-install] Trouble in Building NCL on Mac OS with Ifort andClang

Kian kian-huang at qq.com
Sat Jul 8 07:14:40 MDT 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-install/attachments/20170708/05558bac/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: make-output
Type: application/octet-stream
Size: 1477681 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-install/attachments/20170708/05558bac/attachment-0001.obj 


More information about the ncl-install mailing list