# math/py-numpy fails on FreeBSD 8.1 i386



## jewsofeast (Feb 7, 2011)

Hi,

The above port fails even after installing math/atlas WITH_STATICLIB. I get 
	
	



```
error 1 atlas needs to be build WITH_STATICLIB
```

Can someone help?

Best,

Dave


----------



## DutchDaemon (Feb 7, 2011)

How did you pass WITH_STATICLIB to the make process? Did you use make -DWITH_STATICLIB?


----------



## jewsofeast (Feb 8, 2011)

DutchDaemon said:
			
		

> How did you pass WITH_STATICLIB to the make process? Did you use make -DWITH_STATICLIB?



Hi,

Yeah, I used 

[cmd=]make -DWITH_STATICLIB[/cmd]

and later installed atlas.

best,

dave


----------



## wblock@ (Feb 8, 2011)

jewsofeast said:
			
		

> Hi,
> 
> Yeah, i used
> 
> ...



You have to use the same flag when installing it, too.


----------



## jewsofeast (Feb 8, 2011)

wblock: silly me, is there any way I can correct this quickly without spending too much time on rebuilding atlas (it takes more than 6-7 hours). Best, Dave


----------



## wblock@ (Feb 8, 2011)

jewsofeast said:
			
		

> wblock: silly me, is there anyway i can correct this quickly without spending too much time on rebuilding atlas (it takes more than 6-7 hours). Best, Dave



If you didn't clean the port, it's all still there.  Just deinstall then install.


----------



## jewsofeast (Feb 8, 2011)

wblock said:
			
		

> If you didn't clean the port, it's all still there.  Just deinstall then install.



I dont remember if I cleaned the ports; anyway rebuilding it now. Thanks, dave


----------



## wblock@ (Feb 8, 2011)

If the work directory is still present in the port directory, you can install it again.  For example:

```
# cd /usr/ports/math/atlas
# ls
Makefile	files		pkg-plist
distinfo	pkg-descr	[color="Red"]work[/color]
# make -D WITH_STATICLIB deinstall install
```

Note that there's no "clean" target used; on big ports, it's preferable to not clean it until after it's installed and tested.  The clean target removes the temporary work directory and those of ports that were built as dependencies, if present.


----------



## jewsofeast (Feb 9, 2011)

*math/py-numpy fails*

Hi,

I built the atlas WITH_STATICLIB but py-numpy fails to buid -


```
creating build/temp.freebsd-8.1-RELEASE-i386-2.6/numpy/linalg
compile options: '-DNO_ATLAS_INFO=2 -I/usr/local/include -Inumpy/core/include -Ibuild/src.freebsd-8.1-RELEASE-i386-2.6/numpy/core/include/numpy -
Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -
Inumpy/core/include -I/usr/local/include/python2.6 -Ibuild/src.freebsd-8.1-RELEASE-i386-2.6/numpy/core/src/multiarray -Ibuild/src.freebsd-8.1-
RELEASE-i386-2.6/numpy/core/src/umath -c'
gcc45: numpy/linalg/python_xerbla.c
gcc45: numpy/linalg/lapack_litemodule.c
cc -shared -pthread -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc45 -fno-strict-aliasing build/temp.freebsd-8.1-RELEASE-i386-
2.6/numpy/linalg/lapack_litemodule.o build/temp.freebsd-8.1-RELEASE-i386-2.6/numpy/linalg/python_xerbla.o -L/usr/local/lib -Lbuild/temp.freebsd-
8.1-RELEASE-i386-2.6 -lalapack_r -lalapack_r -lf77blas_r -lcblas_r -latlas_r -lgfortran -lm -lpthread -o build/lib.freebsd-8.1-RELEASE-i386-
2.6/numpy/linalg/lapack_lite.so
/usr/bin/ld: cannot find -lgfortran
/usr/bin/ld: cannot find -lgfortran
error: Command "cc -shared -pthread -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc45 -fno-strict-aliasing build/temp.freebsd-8.1-RELEASE-i386-
2.6/numpy/linalg/lapack_litemodule.o build/temp.freebsd-8.1-RELEASE-i386-2.6/numpy/linalg/python_xerbla.o -L/usr/local/lib -Lbuild/temp.freebsd-
8.1-RELEASE-i386-2.6 -lalapack_r -lalapack_r -lf77blas_r -lcblas_r -latlas_r -lgfortran -lm -lpthread -o build/lib.freebsd-8.1-RELEASE-i386-
2.6/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.
```

Is it just me or the port has flaws.


----------



## jewsofeast (Feb 9, 2011)

I tried with 
[cmd=] ln -s /usr/local/bin/gfortran45 /usr/local/bin/gfortran[/cmd] since it reported make can't find lgfortran, it just wont build.

And [cmd=]ldconfig -r | grep lgfortran[/cmd] returns -

```
1053:-lgfortran.3 => /usr/local/lib/gcc44/libgfortran.so.3
       1060:-lgfortran.3 => /usr/local/lib/gcc45/libgfortran.so.3
```

I guess i've screwed up by linking gfortran45 instead of gfortran44.

can someone help?

best


----------



## jewsofeast (Feb 11, 2011)

Hi,

I need to replace 

[cmd=]ln -s /usr/local/bin/gfortran45 /usr/local/bin/gfortran[/cmd] with

[cmd=]ln -s /usr/local/bin/gfortran44 /usr/local/bin/gfortran[/cmd]

[cmd=]rm /usr/local/bin/gfortran[/cmd] please confirm if this can remove the link.


----------



## jewsofeast (Feb 12, 2011)

Hi,

I removed the link and put in another link but the portupgrade still fails with the same error. Can someone please explain whats wrong with it or what did I screw up or this port is all messed up.

Best,

dave


----------



## jewsofeast (Feb 12, 2011)

I guess I figured out whats messing this port up -

```
usr/bin/ld: cannot find -lgfortran
/usr/bin/ld: cannot find -lgfortran
```

That is where it stops

[cmd=]ldconfig -vr | grep -ie fortran[/cmd]

Gives me -

```
1107:-lgfortran.3 => /usr/local/lib/gcc44/libgfortran.so.3
        1114:-lgfortran.3 => /usr/local/lib/gcc45/libgfortran.so.3
```

I trust I need to change the site.cfg, the defaults are -


```
[DEFAULT]
lapack_type=atlas
library_dirs = /usr/lib:%%LOCALBASE%%/lib:%%GCCLIBDIR%%
include_dirs = /usr/include:%%LOCALBASE%%/include:%%LOCALBASE%%/include/suitesparse
src_dirs = %%LOCALBASE%%/src
# search static libraries (.a) in preference to shared ones (.so)
search_static_first = 0
[atlas]
library_dirs = %%LOCALBASE%%/lib:%%GCCLIBDIR%%
atlas_libs = %%ATLASLIBS%%
```
This is just a guess, I am not fully familiar with FreeBSD; you can call it "Mexican Shoot-out".
Here is my terminal output -
http://pastebin.com/dFNf365v
Can someone help me sort this out?


----------



## jewsofeast (Feb 16, 2011)

I got a patch from 'b' and it worked. I've attached the patch for those who might need it.


----------

