Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jan 2002 18:45:06 +0100
From:      Rahul Siddharthan <rsidd@online.fr>
To:        ports@freebsd.org
Cc:        hackers@freebsd.org
Subject:   Port: Intel Fortran (and C++?) compilers
Message-ID:  <20020124184506.B87867@lpt.ens.fr>

next in thread | raw e-mail | index | archive | help
I have the Intel Fortran compiler[1] for Linux (Red Hat 7.1) working
on my FreeBSD box, and (barring as-yet-unseen glitches) would like to
submit a port by the weekend or so.  I'd like some advice on how to
proceed with the following issues. 

0. I used linux_base-7 because I had it installed already.  Intel has a
   separate download of a different compiler for Red Hat 6.2; I'm not
   sure I want to mess with that now, though.

1. The compiler and its libraries are installed in
      /compat/linux/opt/intel/compiler50/ia32/bin/ifc
   and requires some environment variables pointing to a license file to
   be set before it runs.  I do that with a script called "ifc" in
   /usr/local/bin, which does the right things.  Is there a better way?

#!/bin/sh
LD_LIBRARY_PATH=/compat/linux/opt/intel/compiler50/ia32/lib/
LM_LICENSE_FILE=/compat/linux/opt/intel/licenses/l_for.lic
export LD_LIBRARY_PATH LM_LICENSE_FILE
/compat/linux/opt/intel/compiler50/ia32/bin/ifc $@
 

2. Though the install script (with patches) installs everything to
   /compat/linux/opt/intel, the compiler tends to complain of not finding
   the file /usr/intel/ia32/lib/crtxn.o . I fixed this by making
   a directory /compat/linux/usr/intel and symlinking
   /compat/linux/opt/intel/compiler50/ia32 to /compat/linux/usr/intel/ia32. 
   This works but I'm wondering whether there's a "cleaner" solution. 

3. The compiler by itself compiles, but does not link; it complains
   about lots of undefined symbols.  To get around this, I use the linux
   ld, which is not part of linux_base-7 or any other port as far as I
   see (the linux_devtools seems to be for linux_base-6), so I installed 
   that separately (I could make a separate port of it).  Again, lots 
   of options need to be specified properly on the linker command line, 
   so I made a script to do all that called ifclink.  

   So the end-user's instructions to compile, say, test.f would be
   /usr/local/bin/ifc -c test.f
   /usr/local/bin/ifclink -o test test.o

   Among the things the linker script needs to do are: specify the
   entry symbol (-e main as command line option to ld); specify the Intel
   libraries to link against; and brand the binary as linux.

4. After all this, the binary still complains saying

ELF interpreter /compat/linux/usr/lib/libc.so.1 not found
Abort

   I solve this with a symlink from /compat/linux/ld-2.2.2.so to
   /compat/linux/usr/lib/libc.so.1
   Is there a "cleaner" solution?

At this point, the executable runs (and runs quite nicely and fast, in
fact).

To summarize: as of now, my port would require linux_base-7, install
the binutils rpm of Red Hat 7.1 (I could make a separate port
linux-binutils-7 for that, perhaps), makes a couple of ugly symlinks
in the /compat/linux directory, and installs two scripts -- one to be
used only for compiling, and one for linking.  This is, I think, quite
adequate for most scientific users who are the people who normally
need Fortran.

Do I go ahead with the above as it is, or does anyone have better
ideas?  In particular it will be very nice if someone can get the
Intel compiler to link the code properly.

I think the Intel C++ compiler should be portable along the above
lines too.  In fact I got it to compile C code into .o files quite
easily, which could then be linked with FreeBSD's native ld and
libraries to produce a working native FreeBSD binary.  It didn't work
with C++, but the above approach may have a better chance.

Thanks 

-- Rahul.
(Please cc me; as of now I'm not subscribed to either -ports or
-hackers)

[1] URL: http://developer.intel.com/software/products/compilers/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020124184506.B87867>