﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3618	Compiling From Source Fedora 23	r.trevor.clark@…	somebody	"Hi I have compiled OpenModelica from the latest Git Source. However, I ran into a few issues compiling on Fedora 23. I don't have too much experience so I could have made some mistakes. I have the project in ~/OM/OpenModelica_12_27

On Thing is that the $QTDIR on my system points to /usr/lib64/qt-3.3 and not /usr/lib64/qt4 so I had to pass the  argument QTDIR=/usr/lib64/qt4 in the ./configure step

I started the super project by using the configure options as shown on the website

$ autoconf
$ ./configure CC=clang CXX=clang++ QTDIR=/usr/lib64/qt4
$ make -j8

This compiled the OMCompiler, but the rest of the sub projects OMEdit, OMNotebook etc did not compile automatically, though I don't know if they are supposed to.

OMPlot and OMEdit compiled fine after that.

However when I compiled OMNotebook, OMShell, and OMOptim I got some errors.

OMNotebook:

I was able to get it to compile by changing from clang to gcc and then back to clang. Here is the process I followed.

cd OMNotebook
autoconf
./configure --with-ombuilddir=/home/tclark/OM/OpenModelica_12_27/build/ --prefix=/home/tclark/OM/OpenModelica_12_27/build/ CXX=clang++ QTDIR=/usr/lib64/qt4

make

This gave the error:

textcell.cpp:446:15: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
      qDebug( text.toStdString().c_str() );
              ^~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Makefile:745: recipe for target 'textcell.o' failed

then I configure again without specifying clang.

./configure --with-ombuilddir=/home/tclark/OM/OpenModelica_12_27/build/ --prefix=/home/tclark/OM/OpenModelica_12_27/build/ QTDIR=/usr/lib64/qt4

make

This resulted in this error:

/usr/bin/ld: cellapplication.o: relocation R_X86_64_32S against `_ZTVN4IAEX15CellApplicationE' can not be used when making a shared object; recompile with -fPIC
cellapplication.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:248: recipe for target '../bin/OMNotebook' failed
make[2]: *** [../bin/OMNotebook] Error 1
make[2]: Leaving directory '/home/tclark/OM/OpenModelica_12_27/OMNotebook/OMNotebook/OMNotebookGUI'
Makefile.unix:19: recipe for target 'OMNotebook' failed
make[1]: *** [OMNotebook] Error 2
make[1]: Leaving directory '/home/tclark/OM/OpenModelica_12_27/OMNotebook/OMNotebook/OMNotebookGUI'
Makefile:25: recipe for target 'omnotebook' failed
make: *** [omnotebook] Error 2

Then after re configuring with clang again:

./configure --with-ombuilddir=/home/tclark/OM/OpenModelica_12_27/build/ --prefix=/home/tclark/OM/OpenModelica_12_27/build/ CXX=clang++  QTDIR=/usr/lib64/qt4

make

This then seemed to have finished compiling without error and the program seems to work.

I followed the same process for OMShell clang -> gcc -> clang and it also now seems to work.
The two respective errors for the first two attempts at make are :

 clang

DQT_CORE_LIB -DQT_SHARED -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include -I../generatedfiles/moc -o omc_communicator.o omc_communicator.cpp
omc_communicator.cpp:219:15: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
    qWarning( tmp.c_str() );
              ^~~~~~~~~~~
1 error generated.
Makefile:264: recipe for target 'omc_communicator.o' failed
make[2]: *** [omc_communicator.o] Error 1
make[2]: Leaving directory '/home/tclark/OM/OpenModelica_12_27/OMShell/OMShell/OMShellGUI'
Makefile.unix:20: recipe for target 'OMShell' failed
make[1]: *** [OMShell] Error 2
make[1]: Leaving directory '/home/tclark/OM/OpenModelica_12_27/OMShell/OMShell/OMShellGUI'
Makefile:24: recipe for target 'omshell' failed
make: *** [omshell] Error 2

gcc

mnithread -lQtXml -lQtGui -lQtCore -lpthread 
/usr/bin/ld: commandcompletion.o: relocation R_X86_64_32S against `_ZTVN4IAEX17CommandCompletionE' can not be used when making a shared object; recompile with -fPIC
commandcompletion.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:120: recipe for target '../bin/OMShell' failed
make[2]: *** [../bin/OMShell] Error 1
make[2]: Leaving directory '/home/tclark/OM/OpenModelica_12_27/OMShell/OMShell/OMShellGUI'
Makefile.unix:20: recipe for target 'OMShell' failed
make[1]: *** [OMShell] Error 2
make[1]: Leaving directory '/home/tclark/OM/OpenModelica_12_27/OMShell/OMShell/OMShellGUI'
Makefile:24: recipe for target 'omshell' failed
make: *** [omshell] Error 2

So everything up to then now works. 

However, I was unable to get OMOptim to compile at all.
Here are the two errors I got when trying to compile with clang then gcc.

clang 

/usr/bin/ld: cellapplication.o: relocation R_X86_64_32S against `_ZTVN4IAEX15CellApplicationE' can not be used when making a shared object; recompile with -fPIC
cellapplication.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:248: recipe for target '../bin/OMNotebook' failed
make[2]: *** [../bin/OMNotebook] Error 1
make[2]: Leaving directory '/home/tclark/OM/OpenModelica_12_27/OMNotebook/OMNotebook/OMNotebookGUI'
Makefile.unix:19: recipe for target 'OMNotebook' failed
make[1]: *** [OMNotebook] Error 2
make[1]: Leaving directory '/home/tclark/OM/OpenModelica_12_27/OMNotebook/OMNotebook/OMNotebookGUI'
Makefile:25: recipe for target 'omnotebook' failed
make: *** [omnotebook] Error 2

gcc

/usr/bin/ld: ../../ParadisEO-2.0.1/build/moeo/lib/libmoeo.a(moeoObjectiveVectorTraits.cpp.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
../../ParadisEO-2.0.1/build/moeo/lib/libmoeo.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:104: recipe for target '../bin/OMOptim' failed
make[2]: *** [../bin/OMOptim] Error 1
make[2]: Leaving directory '/home/tclark/OM/OpenModelica_12_27/OMOptim/OMOptim/build'
Makefile.unix:16: recipe for target 'OMOptim' failed
make[1]: *** [OMOptim] Error 2
make[1]: Leaving directory '/home/tclark/OM/OpenModelica_12_27/OMOptim/OMOptim/build'
Makefile:35: recipe for target 'omoptim' failed
make: *** [omoptim] Error 2

Again I don't have very much experience and may have missed something obvious or misunderstood directions, but I am looking for some help to understand and be able to get this working as far as compilation  (everything appears to work aside from OMOptim).

Thank You!"	defect	closed	high	1.12.0	Installation program		fixed	Fedora	
