# Problem in R installation



## madhusoodan (Aug 31, 2009)

Respected members,

I am trying to install R port on my newly installed PCBSD 7.1.1. But it is giving error while it is trying to use GCC43. As per a forum post, I installed GCC 43 with "wothout_java". However, still I am having problem. end of the failed installation looks like this.


```
gmake[1]: *** [bin/../sobin/gsc] Error 1
gmake[1]: Leaving directory `/usr/ports/print/ghostscript8/work/ghostscript-8.64'
gmake: *** [so] Error 2
*** Error code 1

Stop in /usr/ports/print/ghostscript8.
*** Error code 1

Stop in /usr/ports/print/ghostscript8.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portinstall20090831-2805-6ippf4-0 env make
** Fix the problem and try again.
--->  Skipping 'math/R' because a requisite port 'math/atlas' failed (specify -k to force)
--->  Skipping 'print/teTeX-base' because a requisite port 'print/ghostscript8' failed (specify -k to force)
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! math/lapack   (unknown build error)
        * math/atlas
        ! print/ghostscript8    (new compiler error)
        * math/R
        * print/teTeX-base
```

What I can here? If I install latest GCC compiler, then will it work fine?

Kindly guide me.

Regards

Madhusoodan


----------



## ale (Aug 31, 2009)

madhusoodan said:
			
		

> ```
> gmake[1]: *** [bin/../sobin/gsc] Error 1
> gmake[1]: Leaving directory `/usr/ports/print/ghostscript8/work/ghostscript-8.64'
> gmake: *** [so] Error 2
> ...


The problem your are facing is not building R, but building print/ghostscript8. You also had a problem building math/atlas.
Make sure your ports tree is updated and try building those ports and show some more lines about the errors.


----------



## madhusoodan (Aug 31, 2009)

```
[root@pcbsd]/usr/ports/math/lapack(29)# portinstall lapack 
** Found already installed package(s) of 'math/lapack': lapack-3.2.1 
[root@pcbsd]/usr/ports/math/lapack(30)# pkg_delete lapack-3.2.1 
[root@pcbsd]/usr/ports/math/lapack(31)# portinstall lapack 
[Updating the pkgdb <format:bdb_btree> in /var/db/pkg ... - 117 packages found (-1 +0) (...) done] 
[Gathering depends for math/lapack ..................... done] 
--->  Installing 'lapack-3.2.1' from a port (math/lapack) 
--->  Building '/usr/ports/math/lapack' 
===>  Cleaning for lapack-3.2.1 
===>  Vulnerability check disabled, database not found 
You can override F77 and FFLAGS on the command line. 
===>  Extracting for lapack-3.2.1 
=> MD5 Checksum OK for lapack/lapack-3.2.1.tgz. 
=> SHA256 Checksum OK for lapack/lapack-3.2.1.tgz. 
=> MD5 Checksum OK for lapack/manpages-3.2.0.tgz. 
=> SHA256 Checksum OK for lapack/manpages-3.2.0.tgz. 
===>  Patching for lapack-3.2.1 
===>  Applying FreeBSD patches for lapack-3.2.1 
===>   lapack-3.2.1 depends on executable: gfortran43 - found 
===>   lapack-3.2.1 depends on shared library: blas.2 - found 
===>  Configuring for lapack-3.2.1 
===>  Building for lapack-3.2.1 
Building static lapack library 
cd /usr/ports/math/lapack/work/lapack-3.2.1 ; make  ARCH=i386 OPSYS=FreeBSD OSREL=7.2 OSVERSION=702103 SYSTEMVERSION= 
ARCH=ar                                                                                                 
( cd INSTALL; make; ./testlsame; ./testslamch;  ./testdlamch; ./testsecond; ./testdsecnd; ./testversion ) 
gfortran43 -O -c lsame.f -o lsame.o 
gfortran43 -O -c lsametst.f -o lsametst.o 
gfortran43  -o testlsame lsame.o lsametst.o 
gfortran43 -O0 -c slamch.f -o slamch.o 
gfortran43 -O -c slamchtst.f -o slamchtst.o 
gfortran43  -o testslamch slamch.o lsame.o slamchtst.o 
gfortran43 -O0 -c dlamch.f -o dlamch.o
gfortran43 -O -c dlamchtst.f -o dlamchtst.o
gfortran43  -o testdlamch dlamch.o lsame.o dlamchtst.o
gfortran43 -O -c second_INT_ETIME.f -o second_INT_ETIME.o
gfortran43 -O -c secondtst.f -o secondtst.o
[INFO] : TIMER value: INT_ETIME (given by make.inc)
gfortran43  -o testsecond second_INT_ETIME.o secondtst.o
gfortran43 -O -c dsecnd_INT_ETIME.f -o dsecnd_INT_ETIME.o
gfortran43 -O -c dsecndtst.f -o dsecndtst.o
[INFO] : TIMER value: INT_ETIME (given by make.inc)
gfortran43  -o testdsecnd dsecnd_INT_ETIME.o dsecndtst.o
gfortran43 -O -c tstiee.f -o tstiee.o
gfortran43  -o testieee tstiee.o
gfortran43 -O -c ilaver.f -o ilaver.o
gfortran43 -O -c LAPACK_version.f -o LAPACK_version.o
gfortran43  -o testversion ilaver.o LAPACK_version.o
/libexec/ld-elf.so.1: Shared object "libgfortran.so.3" not found, required by "testlsame"
*** Error code 1

Stop in /usr/ports/math/lapack/work/lapack-3.2.1.
*** Error code 1

Stop in /usr/ports/math/lapack.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portinstall20090831-63794-1a3paxl-0 env make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! math/lapack   (unknown build error)

 ************************************************************ 
./bin/../sobin/libgs.so: undefined reference to `cairo_scale' 
./bin/../sobin/libgs.so: undefined reference to `cairo_set_miter_limit' 
./bin/../sobin/libgs.so: undefined reference to `cairo_reference' 
./bin/../sobin/libgs.so: undefined reference to `cairo_status' 
./bin/../sobin/libgs.so: undefined reference to `cairo_show_page' 
./bin/../sobin/libgs.so: undefined reference to `cairo_ps_surface_set_eps' 
./bin/../sobin/libgs.so: undefined reference to `cairo_set_line_join' 
./bin/../sobin/libgs.so: undefined reference to `cairo_surface_finish' 
./bin/../sobin/libgs.so: undefined reference to `cairo_set_line_width' 
./bin/../sobin/libgs.so: undefined reference to `cairo_get_target' 
./bin/../sobin/libgs.so: undefined reference to `cairo_pattern_destroy' 
./bin/../sobin/libgs.so: undefined reference to `cairo_restore' 
./bin/../sobin/libgs.so: undefined reference to `cairo_clip_preserve' 
./bin/../sobin/libgs.so: undefined reference to `cairo_move_to'
./bin/../sobin/libgs.so: undefined reference to `cairo_surface_flush'
./bin/../sobin/libgs.so: undefined reference to `cairo_pattern_reference'
./bin/../sobin/libgs.so: undefined reference to `cairo_create'
./bin/../sobin/libgs.so: undefined reference to `cairo_pdf_surface_create_for_stream'
./bin/../sobin/libgs.so: undefined reference to `cairo_get_source'
./bin/../sobin/libgs.so: undefined reference to `cairo_surface_destroy'
./bin/../sobin/libgs.so: undefined reference to `cairo_pattern_create_rgb'
./bin/../sobin/libgs.so: undefined reference to `cairo_surface_status'
./bin/../sobin/libgs.so: undefined reference to `cairo_svg_surface_create_for_stream'
./bin/../sobin/libgs.so: undefined reference to `cairo_set_line_cap'
gmake[1]: *** [bin/../sobin/gsc] Error 1
gmake[1]: Leaving directory `/usr/ports/print/ghostscript8/work/ghostscript-8.64'
gmake: *** [so] Error 2
*** Error code 1

Stop in /usr/ports/print/ghostscript8.
*** Error code 1

Stop in /usr/ports/print/ghostscript8.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portinstall20090831-19942-c0nhy2-0 env make
** Fix the problem and try again.
--->  Skipping 'math/R' because a requisite port 'math/atlas' failed (specify -k to force)
--->  Skipping 'print/teTeX-base' because a requisite port 'print/ghostscript8' failed (specify -k to force)
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! math/lapack   (unknown build error)
        * math/atlas
        ! print/ghostscript8    (new compiler error)
        * math/R
        * print/teTeX-base
[root@pcbsd]/usr/ports/math/R(19)#
```

Respected Sir,

This is end of both installation processes. Most of the screen I could copy.

I am updating ports collection. I will retry installing after that.

Regards

Madhusoodan


----------



## madhusoodan (Aug 31, 2009)

Respected Sir,

I am able to install "lapack" with pkg_add. Now only ghostscript is remaining. It is constantly giving "new compiler" error. 

Kindly guide me about it.

Regards

madhusoodan


----------



## ale (Aug 31, 2009)

Can we see the output of `$ pkg_version -l "<"`?


----------



## madhusoodan (Aug 31, 2009)

Respected Sir,

Result for that command is "pkg_version: No match."

Still no success in building ghostscript.

for atlas package, it could not find "valid f77 compiler". After many hours of trying, I am still unable to install GCC 4.5 with fortron. I am stuck at configuration. There is tons of information and no examples. I am not understanding easiest way to go. I am also downloading intel non-commercial fortron compiler. 

kindly direct me in right direction.

Regards

Madhusoodan


----------



## ale (Aug 31, 2009)

About ghostscript8, are you trying to build it with some non-default options?
I had often problem in the past doing so. I was constantly reporting problem to the maintainer who were fixing them. But on the next release, new problem were popping out (they are also so much), so I started to build it with the default options. To reset, you type `# make rmconfig` on the port directory.
We also need some more lines about the error.

EDIT:
do you have graphics/cairo and x11-toolkits/pango installed?
I think that this is caused by a change (in 8.63) that could add some dependencies and/or should be ported in the Makefile.

EDIT2:
here there is a PR with a patch that should fix your problem for you too:
http://www.freebsd.org/cgi/query-pr.cgi?pr=137634


----------



## madhusoodan (Sep 3, 2009)

*still in dark*

Respected Sir,

As of my limited knowledge, I copied the patch file in makefile and deleated rest of the content. After that I gave # make rmconfig and ./configure and make. After ./configure command, I did not get any error. But after make command, I got following errors. Did I do anything wrong? How to use that patch file?


```
checking for sqrt... yes
checking for strchr... yes
checking for strerror... yes
checking for strrchr... yes
checking for strspn... yes
checking for strstr... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cups/pstopxl
config.status: creating cups/pstoraster
[root@pcbsd]/usr/home/madhusoodan/Downloads/ghostscript-8.70(106)# make
gcc -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-
statement -fno-builtin -fno-common -DHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned long long" -I./base -o ./obj/genconf ./base/genconf.c
gcc: ./base/genconf.c: No such file or directory
gcc: No input files specified
*** Error code 1
```

I am trying to install atlas which is another prerequisite for R. But I am getting following error.


```
cmnd=make IRunCComp CC='gcc43' CCFLAGS='-O -fomit-frame-pointer -m32' | fgrep SUCCESS
   gcc43 -O -fomit-frame-pointer -m32 : SUCCESS!
cmnd=make IRunCComp CC='gcc43' CCFLAGS='-O -fomit-frame-pointer -m32' | fgrep SUCCESS
   gcc43 -O -fomit-frame-pointer -m32 : SUCCESS!
/libexec/ld-elf.so.1: Shared object "libgfortran.so.3" not found, required by "xf77test"
cmnd=make IRunF77Comp F77='gfortran43' F77FLAGS='-fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -m32' | fgrep SUCCESS
   gfortran43 -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -m32 : FAILURE!
/libexec/ld-elf.so.1: Shared object "libgfortran.so.3" not found, required by "xf77test"
cmnd=make IRunF77Comp F77='gfortran43' F77FLAGS='-O -m32' | fgrep SUCCESS
   gfortran43 -O -m32 : FAILURE!
/libexec/ld-elf.so.1: Shared object "libgfortran.so.3" not found, required by "xf77test"
cmnd=make IRunF77Comp F77='gfortran43' F77FLAGS='-O -m32' | fgrep SUCCESS
   gfortran43 -O -m32 : FAILURE!
/libexec/ld-elf.so.1: Shared object "libgfortran.so.3" not found, required by "xf77test"
cmnd=make IRunF77Comp F77='gfortran43' F77FLAGS='-O -m32' | fgrep SUCCESS
   gfortran43 -O -m32 : FAILURE!


Unable to find usable compiler for F77; abortingMake sure compilers are in your path, and specify good compilers to configure
(see INSTALL.txt or 'configure --help' for details)*** Error code 7

Stop in /usr/ports/math/atlas/work/ATLAS/NON_THREADED.
*** Error code 1

Stop in /usr/ports/math/atlas/work/ATLAS/NON_THREADED.
Assertion failed: (!system(ln)), function ProbeComp, file /usr/ports/math/atlas/work/ATLAS/NON_THREADED/..//CONFIG/src/config.c, line 125.
Abort trap
xconfig exited with 134
*** Error code 134

Stop in /usr/ports/math/atlas.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portinstall20090903-91656-vcmajz-0 env make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! math/atlas    (unknown build error)
```

I have downloaded intel's fortran compiler. But not understanding how to install it. As of my limited understanding, GCC is capable of building fortran codes. But not understanding why my machine is saying it is unable to find compiler for F77.

Kindly help me. I am totally lost.  

Regards

Madhusoodan


----------



## ale (Sep 3, 2009)

About ghostscript, the patch should be applied to the Makefile in the ports directory. You don't have to download and install an arbitrary version by yourself.

About atlas, libgfortran.so.3 should be installed by lang/gcc43.
Can you check if the file is really missing with `$ ls -la /usr/local/lib/gcc43/libgfortran.so.3`?
Eventually, can you try reinstalling gcc43 and check again?
Is your ports tree updated and are the installed packages updated too as well? (check with `$ pkg_version -l "<"`)


----------



## SeanC (Sep 3, 2009)

R 2.9.2 is available as a package. Might be easier to just 
	
	



```
pkg_add -r R
```
 No?


----------

