problem with matlab interface - gfortran not found

427 views
Skip to first unread message

lsfey

unread,
Apr 18, 2012, 7:08:03 AM4/18/12
to TANGO Project - ALGENCAN
hi,

i try to get the matlab interface run on linux ubuntu (matlab11b) and
get the following error when typing
make algencan-matlab:

gfortran -O4 -xf77-cpp-input -fPIC -c -o algencanma.o algencanma.f
make[1]: gfortran: Command not found
make[1]: *** [algencanma.o] error 127

how can i fix this?

Thx in advance!

Ernesto G. Birgin

unread,
Apr 18, 2012, 10:22:34 AM4/18/12
to tango-...@googlegroups.com
Hi!

You should install gfortran.

Moreover, as it was already reported on the list, we were not able to compile the Matlab interface compiler versions superior to 4.2. It means that, in the make files, you must substitute gfortran by gfortran-4.2, gcc by gcc-4.2, and g++ by g++-4.2.

I hope it helps.

Regards,
Ernesto.

Ricardo

unread,
Apr 18, 2012, 10:19:30 AM4/18/12
to tango-...@googlegroups.com
Hi lsfey,
thanks for your interest in ALGENCAN.
You need to install gfortran.
Which operational system are you using?


Best regards,


Ricardo

lsfey

unread,
Apr 18, 2012, 12:09:41 PM4/18/12
to TANGO Project - ALGENCAN
Thank you for your fast answers!
thanks to your suggestions i succeeded in building the algencan.mexa64
and proceeded as in the readme.
but if i run the algencanma now my matlab crashes, i get the following
message:

------------------------------------------------------------------------
Segmentation violation detected at Wed Apr 18 17:50:51 2012
------------------------------------------------------------------------

Configuration:
Crash Decoding : Disabled
Current Visual : 0x21 (class 4, depth 24)
Default Encoding: UTF-8
GNU C Library : 2.13 stable
MATLAB Root : /home/lukas/matlab
MATLAB Version : 7.13.0.564 (R2011b)
Operating System: Linux 2.6.38-13-generic #53-Ubuntu SMP Mon Nov 28
19:33:45 UTC 2011 x86_64
Processor ID : x86 Family 15 Model 10 Stepping 0, AuthenticAMD
Virtual Machine : Java 1.6.0_17-b04 with Sun Microsystems Inc. Java
HotSpot(TM) 64-Bit Server VM mixed mode
Window System : The X.Org Foundation (11001000), display :0
[...]
This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for
information
on debugging MEX-files.

If this problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/

A technical support engineer might contact you with further
information.
------------------------------------------------------------------------

i noticed that someone else reported of a similar problem here years
ago, but i couldn't find
a solution report. do you know how to fix it? i really like to test
your program on my large scale problems
(unfortunately written in matlab).

Thank you in advance!

Francisco Sobral

unread,
Apr 18, 2012, 2:42:55 PM4/18/12
to lsfey, TANGO Project - ALGENCAN
Dear Isfey,

as Ernesto said, this segmentation error occurs because the latest
version of gcc that was tested by mex was 4.2. So, you have to
download and install gcc-4.2, gfortran-4.2 and g++-4.2, plus their
dependencies. After instaling, you have to open mexopts.sh (located in
algencan-2.3.7/sources/interfaces/matlab/) and substitute gcc by
gcc-4.2, gfortran by gfortran-4.2 and g++ by g++-4.2. In the file
Makefile (located in algencan-2.3.7/) you also have to substitute
gfortran by gfortran-4.2.

If you are using Ubuntu, the fastest way for downloading gcc-4.2 is to
add the following repositories to file /etc/apt/sources.list:

deb http://br.archive.ubuntu.com/ubuntu/ hardy-updates main restricted
universe multiverse
deb-src http://br.archive.ubuntu.com/ubuntu/ hardy-updates main
restricted universe multiverse

and update the list of repositories:

sudo apt-get update

Then, install gcc-4.2.

Best regards,
Francisco Sobral.

> --
> You received this message because you are subscribed to the Google Groups "TANGO Project - ALGENCAN" group.
> To post to this group, send email to tango-...@googlegroups.com.
> To unsubscribe from this group, send email to tango-projec...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/tango-project?hl=en.
>

--
Francisco Sobral

lsfey

unread,
Apr 20, 2012, 3:42:59 AM4/20/12
to TANGO Project - ALGENCAN
Dear all,

thank you for your help!
I did so like explained above (the -4.2 instead of the newer ones) and
got always:

/usr/bin/ld.bfd.real: cannot find -lgcc_s
collect2: ld returned 1 exit status

mex: link of ' "algencan.mexa64"' failed.

I did the fix to the linker according to
https://blogs.oracle.com/mandalika/entry/quick_fix_to_the_linker
and it seemed to work now (there is an algencan.mexa64 in
algencan-2.3.7/bin/matlab and I didn't get any errors only a warning:
fparamm64.f:470: warning: no newline at end of file) ...
but when running the algencanma now following error occures:

>> algencanma
Invalid MEX-file '/home/lukas/algencan-2.3.7/bin/matlab/
algencan.mexa64':
/home/lukas/algencan-2.3.7/bin/matlab/algencan.mexa64: undefined
symbol: _gfortran_dtime

Error in algencanma (line 19)
[x,lambda,f,cnorm,snorm,nlpsupn,inform] = ...

Again I do not know how to fix this.

Best regards,
luk

On 18 Apr., 20:42, Francisco Sobral <chicosob...@gmail.com> wrote:
> Dear Isfey,
>
> as Ernesto said, this segmentation error occurs because the latest
> version of gcc that was tested by mex was 4.2. So, you have to
> download and install gcc-4.2, gfortran-4.2 and g++-4.2, plus their
> dependencies. After instaling, you have to open mexopts.sh (located in
> algencan-2.3.7/sources/interfaces/matlab/) and substitute gcc by
> gcc-4.2, gfortran by  gfortran-4.2 and g++ by g++-4.2. In the file
> Makefile (located in algencan-2.3.7/) you also have to substitute
> gfortran by gfortran-4.2.
>
> If you are using Ubuntu, the fastest way for downloading gcc-4.2 is to
> add the following repositories to file /etc/apt/sources.list:
>
> debhttp://br.archive.ubuntu.com/ubuntu/hardy-updates main restricted
> universe multiverse
> deb-srchttp://br.archive.ubuntu.com/ubuntu/hardy-updates main

lsfey

unread,
Apr 19, 2012, 6:46:38 PM4/19/12
to TANGO Project - ALGENCAN
Dear all,

thank you for your help!
I did so like explained above (the -4.2 instead of the newer ones) and
got always:

/usr/bin/ld.bfd.real: cannot find -lgcc_s
collect2: ld returned 1 exit status

mex: link of ' "algencan.mexa64"' failed.

I did the fix to the linker according to
https://blogs.oracle.com/mandalika/entry/quick_fix_to_the_linker
and it seemed to work now (there is an algencan.mexa64 in
algencan-2.3.7/bin/matlab and I didn't get any errors only a warning:
fparamm64.f:470: warning: no newline at end of file) ...
but when running the algencanma now following error occures:

>> algencanma
Invalid MEX-file '/home/lukas/algencan-2.3.7/bin/matlab/
algencan.mexa64':
/home/lukas/algencan-2.3.7/bin/matlab/algencan.mexa64: undefined
symbol: _gfortran_dtime

Error in algencanma (line 19)
[x,lambda,f,cnorm,snorm,nlpsupn,inform] = ...

Again I do not know how to fix this.

Best regards,
luk


On 18 Apr., 20:42, Francisco Sobral <chicosob...@gmail.com> wrote:
> Dear Isfey,
>
> as Ernesto said, this segmentation error occurs because the latest
> version of gcc that was tested by mex was 4.2. So, you have to
> download and install gcc-4.2, gfortran-4.2 and g++-4.2, plus their
> dependencies. After instaling, you have to open mexopts.sh (located in
> algencan-2.3.7/sources/interfaces/matlab/) and substitute gcc by
> gcc-4.2, gfortran by  gfortran-4.2 and g++ by g++-4.2. In the file
> Makefile (located in algencan-2.3.7/) you also have to substitute
> gfortran by gfortran-4.2.
>
> If you are using Ubuntu, the fastest way for downloading gcc-4.2 is to
> add the following repositories to file /etc/apt/sources.list:
>
> debhttp://br.archive.ubuntu.com/ubuntu/hardy-updates main restricted
> universe multiverse
> deb-srchttp://br.archive.ubuntu.com/ubuntu/hardy-updates main

Francisco Sobral

unread,
Apr 20, 2012, 8:04:26 AM4/20/12
to lsfey, TANGO Project - ALGENCAN
Dear Isfey,

This error usually occurs when some parts of the code were compiled
using different versions of gfortran. Have you changed to gfortran-4.2
in the file algencan-2.3.7/Makefile? If the answer is YES, then try
the following steps:

1) Enter in the directory algencan-2.3.7
2) type

make clean

3) type

make algencan-matlab 64BITS=true

if you have a 64 bits operational system or

make algencan-matlab

if you have a 32 bits operational system.

4) Follow the steps in the README in order to run your problem.


Best regards,
Francisco

Reply all
Reply to author
Forward
0 new messages