Topic: installation on Mac OS X

Hi, I'm trying to compile oofem on my Mac OS X but it seems it's not possible.

Has anybody done it?
Is there an executable file for Mac (.dmg?)....

I really thank you,
Enrico

2

Re: installation on Mac OS X

Hi Enrico,
Unfortunately, I have no access to any Mac at the moment. But since OS X is Unix based, it should be possible to compile oofem on this platform.
As far as I know, Apple provides a set of free development tools (GCC based), see http://developer.apple.com/tools/
I am interested in resolving the compilation problem on Mac. If there will be no response from someone, who has already succeeded, we can try this in cooperation. In general, you should follow installation instructions for unix, as described
in README file.

Could you be more specific, what is going wrong?

Borek.

Re: installation on Mac OS X

Hi Borek, really thank you.
I'm not so good with Unix, but I did this:

./configure

and it answered (I write only the wrong answers):

checking whether the C++ compiler (c++  ) is a cross-compiler... no
..
checking for malloc.h... (cached) no
..
checking for strtod... (cached) no
checking for strtol... (cached) no
checking for nearest... (cached) no
checking FALSE, TRUE enum/constants... no
...
checking Determining hostname... hostname: illegal option -- f
usage: hostname [-s] [name-of-host]
...
oofemlib/src/oofemcfg.h is unchanged
...
Modules to be included: oofemlib sm tm fm
____

For malloc.h I suppose the problem is BSD, that should use another file. But for the others I don't know.

Then, after the "make all" command, it told me:

c++ -c -D__OOFEMLIB_MODULE -D__SM_MODULE -D__TM_MODULE -D__FM_MODULE -O -Wall   conTable.C -o ../oofem_obj/Release/conTable.o
conTable.C:41:20: error: malloc.h: No such file or directory
make[2]: *** [../oofem_obj/Release/conTable.o] Error 1
make[1]: *** [oofemlib-release] Error 2
make: *** [oofem-release] Error 2

So it's surely a problem with malloc.h......

Enrico

P.S. I tried also with X11, it's the same!

4

Re: installation on Mac OS X

Hi Enrico,

could you send me the complete output from configure script? (You can redirect output to a file by running "./configure > file"). This could reveal a lot of problems with configuration. Another question: are you using GNU compiler or different one. I thing that GNU compiler would be a good starting point.

Borek

Re: installation on Mac OS X

Hi Borek, this is the configure output file:

computer-di-enrico-pulcini-2:~/oofem-1.7 enricopulcini$ ./configure
loading cache ./config.cache
checking host system type... i386-apple-darwin8.10.1
checking for c++... (cached) c++
checking whether the C++ compiler (c++  ) works... yes
checking whether the C++ compiler (c++  ) is a cross-compiler... no
checking whether we are using GNU C++... (cached) yes
checking whether c++ accepts -g... (cached) yes
checking how to run the C++ preprocessor... (cached) c++ -E
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking for ranlib... (cached) ranlib
checking whether make sets ${MAKE}... (cached) yes
checking for ANSI C header files... (cached) yes
checking for limits.h... (cached) yes
checking for malloc.h... (cached) no
checking for strings.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for sys/resource.h... (cached) yes
checking whether time.h and sys/time.h may both be included... (cached) yes
checking for strstr... (cached) yes
checking for strtod... (cached) no
checking for strtol... (cached) no
checking for strncasecmp... (cached) yes
checking for access... (cached) yes
checking for nearest... (cached) no
checking FALSE, TRUE enum/constants... no
checking typedef bool... yes
checking M_PI constant... yes
checking M_LN2 constant... yes
checking STL support... yes
checking Macro __VA_ARGS__ support... yes
checking Function Templates support... yes
checking for sqrt in -lm... (cached) yes
checking Determining hostname... hostname: illegal option -- f
usage: hostname [-s] [name-of-host]

checking OOFEM version... 1.7
creating ./config.status
creating oofemlib/src/makefile
creating oofemlib/src/oofemdef.h
creating sm/src/makefile
creating tm/src/makefile
creating fm/src/makefile
creating main/src/makefile
creating tools/makefile
creating tests/do_test
creating makefile
creating oofemlib/src/oofemcfg.h
oofemlib/src/oofemcfg.h is unchanged

Modules to be included: oofemlib sm tm fm
Targets to be built: oofem-release


About GNU compiler, Apple uses GCC wich should be a GNU one.
About malloc.h, I found that FreeBSD and Mac OS X use stdlib.h instead....but how can we do?

Enrico

6

Re: installation on Mac OS X

Hi Enrico,

the only serious problem seems to be missing malloc.h. I have searched all oofem sources and malloc.h is included only once in oofemLib/src/conTable.C  file. You should edit this file and remove line, where malloc.h is included. The stdlib.h is is included here as well, so this should work. After this, try to compile and send me any error(s), if they come up.

best regards
Borek

Re: installation on Mac OS X

It seems to work!!!
I really thank you,
Enrico