c416 [Solved] lgfortran not found - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Ports & Packages > Installation and Maintenance of FreeBSD Ports or Packages

Installation and Maintenance of FreeBSD Ports or Packages Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. third party software).

Reply
 
Thread Tools Display Modes
  #1  
Old January 27th, 2009, 19:57
nv05 nv05 is offline
Junior Member
 
Join Date: Nov 2008
Location: Seattle, WA
Posts: 8
Thanks: 3
Thanked 0 Times in 0 Posts
Default lgfortran not found

I recently updated my work computer from 6_3 to 7_1 (the full reinstall way). Everything runs correctly except for what seems like a problem building ports with gfortran. I'm trying to get a couple of numerical programs [R, numpy] to compile on my machine. I installed both gcc42 and gcc43 and both libgfortran libraries are correctly (from what I know) installed and found with ldconfig.

Code:
> ldconfig -r | grep
1170:-lgfortran.2 => /usr/local/lib/gcc-4.2.5/libgfortran.so.2
1182:-lgfortran.3 => /usr/local/lib/gcc-4.3.3/libgfortran.so.3
However py-numpy build fails with the following output:
Code:
######################################
...
creating build/temp.freebsd-7.1-RELEASE-p2-i386-2.5/numpy/linalg
compile options: '-DNO_ATLAS_INFO=2 -I/usr/local/include -Inumpy/core/include -Ibuild/src.freebsd-7.1-RELEASE-p2-i386-
2.5/numpy/core/include/numpy -Inumpy/core/src -Inumpy/core/include -I/usr/local/include/python2.5 -c'
cc: numpy/linalg/python_xerbla.c
cc: numpy/linalg/lapack_litemodule.c
cc -shared -pthread -O2 -fno-strict-aliasing -pipe build/temp.freebsd-7.1-RELEASE-p2-i386-2.5/numpy/linalg/lapack_litemodule.o 
build/temp.freebsd-7.1-RELEASE-p2-i386-2.5/numpy/linalg/python_xerbla.o -L/usr/local/lib -lalapack_r -lalapack_r -lf77blas_r -lcblas_r -
latlas_r -lgfortran -lm -lpthread -o build/lib.freebsd-7.1-RELEASE-p2-i386-2.5/numpy/linalg/lapack_lite.so
/usr/bin/ld: cannot find -lgfortran
/usr/bin/ld: cannot find -lgfortran
error: Command "cc -shared -pthread -O2 -fno-strict-aliasing -pipe build/temp.freebsd-7.1-RELEASE-p2-i386-2.5/numpy/linalg/lapack_litemodule.o 
build/temp.freebsd-7.1-RELEASE-p2-i386-2.5/numpy/linalg/python_xerbla.o -L/usr/local/lib -lalapack_r -lalapack_r -lf77blas_r -lcblas_r -
latlas_r -lgfortran -lm -lpthread -o build/lib.freebsd-7.1-RELEASE-p2-i386-2.5/numpy/linalg/lapack_lite.so" failed with exit status 1
*** Error code 1

Stop in /usr/ports/math/py-numpy.
*** Error code 1

Stop in /usr/ports/math/py-numpy.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade.2847.0 env make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! math/py-numpy (compiler error)
#########################################
and R fails with this output:
Code:
#########################################
mkdir /usr/ports/math/R/work/R-2.8.1/lib
cc -std=gnu99      -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H  -fpic  -O2 -fno-strict-aliasing -pipe -c 
Rmain.c -o Rmain.o
cc -std=gnu99 -export-dynamic -L/usr/local/lib -o R.bin Rmain.o -L../../lib -lR
/usr/local/lib/libblas.so.2: undefined reference to `_gfortran_runtime_error_at'
*** Error code 1

Stop in /usr/ports/math/R/work/R-2.8.1/src/main.
*** Error code 1

Stop in /usr/ports/math/R/work/R-2.8.1/src/main.
*** Error code 1

Stop in /usr/ports/math/R/work/R-2.8.1/src.
*** Error code 1

Stop in /usr/ports/math/R/work/R-2.8.1.
*** Error code 1

Stop in /usr/ports/math/R.
*** Error code 1

Stop in /usr/ports/math/R.
######################################
Both problems occur with or without using the ATLAS [math/atlas] libraries. I've rebuilt math/lapack and math/blas with no luck as lately as today with no change, I'm not about to rebuild ATLAS unless absolutely needed (18 hours).

Any thoughts on either of these problems? I've searched the web thinking that this would definitely be a common problem since I did not do anything unusual when installing 7_1. I only see the R problem on one hit with no solution. Something about USE_FORTRAN=yes now meaning gfortran4.3 is used as the default fortran compiler. That didn't help me much.


Thanks for any help in advance.

Last edited by DutchDaemon; July 17th, 2010 at 19:16.
Reply With Quote
  #2  
Old February 1st, 2009, 09:04
rhurlin's Avatar
rhurlin rhurlin is offline
Junior Member
 
Join Date: Nov 2008
Location: Northeim, Germany
Posts: 21
Thanks: 0
Thanked 6 Times in 3 Posts
Default lgfortran not found

I have to set a link to gfortran in this way:

ln -s /usr/local/bin/gfortran42 /usr/local/bin/gfortran

OR

ln -s /usr/local/bin/gfortran43 /usr/local/bin/gfortran

This depends on what version you want to use. After that, math/R and math/py-numpy are able to find the gfortran compiler.

I hope this helps,
Rainer

Last edited by DutchDaemon; July 17th, 2010 at 19:16.
Reply With Quote
The Following User Says Thank You to rhurlin For This Useful Post:
will (July 22nd, 2011)
  #3  
Old July 15th, 2009, 18:24
nv05 nv05 is offline
Junior Member
 
Join Date: Nov 2008
Location: Seattle, WA
Posts: 8
Thanks: 3
Thanked 0 Times in 0 Posts
Default

I eventually gave up and reinstalled all my ports. That worked quite nicely, and didn't take as long as I imagined.

I have since updated to FBSD 7.2 with no problems.
Reply With Quote
  #4  
Old July 22nd, 2011, 21:31
will will is offline
Junior Member
 
Join Date: Jul 2011
Posts: 1
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thank you, rhurlin, for your post. I was trying to compile scipy from source, and got the following
Code:
error: library dfftpack has Fortran sources but no Fortran compiler found"\
I created the link from gfortran45 to gfortran, as you suggested, and it compiled like a charm.

Last edited by DutchDaemon; July 23rd, 2011 at 01:10. Reason: proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
8.0-current: no disks found! zeiz FreeBSD Development 7 February 26th, 2009 08:09
RPM error when launching (libgssapi.so.10 not found) vyrtosu Installation and Maintenance of FreeBSD Ports or Packages 7 January 28th, 2009 15:33
No library found for -lnsl bloodhound Installation and Maintenance of FreeBSD Ports or Packages 3 January 23rd, 2009 22:39
files from ports not found in database fleshm Installation and Maintenance of FreeBSD Ports or Packages 6 January 23rd, 2009 22:33
466 gig lost+found file Pushrod General 2 December 27th, 2008 08:24


All times are GMT +1. The time now is 06:19.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0