link against a legacy library: -lgfortranbegin from a premade makefile - c++

I got some trouble trying to compile a programm developed by some researcher supposed to compute in a very precise way fourier transform and some other useful operation scientific paper here, whereas all the files needed and the makefile are provided.
I use gcc and a version of ubuntu available on windows10 (18.04), so, I linked all the librabries needed by the program and called in the pre-made makefile (fftw, lapack, gfortran..) everything is ok untill here, but once I tried to compile I got the error message:
/usr/bin/ld: cannot find -lgfortranbegin
collect2: error: ld returned 1 exit status
Makefile:38: recipe for target 'furian_main' failed
make: *** [furian_main] Error 1
After a few research it appears that libfortranbegin is a legacy code and no more available(source: here ) ..
So my question is: is it possible for me to compile my program without this legacy library (somme people say that we could get rid off this library, but I didn't understand what they do .. here)
Or should I do some update or use another library ?
Thank you for your time and consideration :)

The usual way of solving this is the following one:
remove the -lgfortranbegin
check the new link errors and look at what source file from the original source code implemented this feature
add this source file to your repository and your build and go back to step 2.
Be aware that it may still not work in the end, but hopefully you will be able to have the missing symbols.

Related

Suggestions to compile the program fung-calc

Im trying to compile the program called fungcalc, its a graph software which the last version was made on 2003, it was designed to run in kde 3.5 (qt3).
Now the steps that I did was to install the qt3 libs, and the required componens missing based in the
./configure --disable-kde-app
this argument remove the support for kde (and the need for its libs too).
When compiling it stops almost at the end (since many .so where compiled but not the main executable)with the next output
/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:412: libfungcalc.la] Error 1
make[4]: Leaving directory '/fung-calc-1.3.2b/src/libfungcalc'
With the same error for the lines 277,337,495,505 of the Makefile.
So what suggestion could be so I can start to roam the entire code?
The entire Makefile is here
I don't know if this runs on 64 bits (but I suppose it does).

Compile c++ code in R does not work anymore

I start saying that i am a newbie in programming and then i am not sure i will be able to explain well my problem.
I had some c++ code i wrote, this code are loaded and used by some R functions.
To compile the code i used the following:
R CMD SHLIB MyCode.cpp
and i loaded the library in R with
dyn.load("MyCOde.so")
Sometimes i built also an R package and i was able to load it into R.
If i do all these stuff on a Mac with mountain lion everything work fine, but now that i switched to mavericks, i have some problems. The R CMD SHLIB MyCode.cpp command works but when i used dyn.load("MyCOde.so") i get the following text:
Errore in dyn.load(paste(dir_function, "MyCOde.so", sep = "")) :
unable to load shared object 'MyCOde.so':
dlopen(MyCOde.so, 6): Symbol not found: __ZNSt8ios_base4InitC1Ev
Referenced from: MyCOde.so
Expected in: flat namespace
in MyCOde.so
Moreover if i try to load the package in R, i get the following
ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: library not found for -lquadmath
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [MyCode.so] Error 1
Can someone helps me?
Based on the helpful website of:
thecoatlessprofessor
Type this into your terminal shell:
curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2
sudo tar fvxz gfortran-4.8.2-darwin13.tar.bz2 -C /
This will create what you need to resume compiling as before.
Since it starts to work I can publish the answer for such a cases.
When you change the compiler and standard libraries - please note that different libraries have different implementation and different standard support. Changing the basement of your system might require total rebuild of your system with the new C++ standard library.
Your libraries are not the exception. So if have the errors in your linker like this:
warning: directory not found for option
'-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
apply next algorithm:
Check whether the directory /usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 still exists. I bet it is not.
Check if you still have the libstdc++ from the missed compiler? Usually if you upgrade the same compiler and the C++ standard library ABI does not change everything should continue to work. If the ABI changed or you switch standard C++ library and compiler - you face the massive system rebuild.
Recompile your library and apps with the new C++ standard library and compiler.

How to compile atanks from windows?

I'm starting to learn C++ to make a game, I compiled some little programs and it worked fine to learn. Now I want to compile a game and learn how it was done.
The game I'm trying to compile is ATANKS (https://libregamewiki.org/Atanks).
First problem I have is the makefile contains an instruction on the target WINUSER that gives me error (it doesn't found the directory INSTALLDIR), I tried to compile manually entering SRC directory and run MAKE -f makefile.windows, it start to compile and stops with this error:
c:/tdm-gcc-64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-min
gw32/bin/ld.exe: atanks.o: bad reloc address 0x20 in section `.data'
collect2.exe: error: ld returned 1 exit status
make: *** [../atanks.exe] Error 1
Because a comment in the file atanks.rc I asume this was writed using DEV-C++ but it hasn't the .DEV project file.
Some info:
I'm using windows 7 64 bits.
I have installed DEV-C++, but for my game I'm using CODEBLOCKS.
Installed TDM-GCC-4.8.1-3 and allegro-4.4.2-mingw-4.5.2
Installed make-3.81
The PATH variable is: PATH=c:\TDM-GCC-64\bin\;"c:\Program Files (x86)\GnuWin32\bin\";
Other thing I tryed is making a CODEBLOCKS project, it seems to go but give me some errors too.
Thanks in advance and forgive me the bad english :)
(maybe someone can recommend me a forum to ask more, better if the language is spanish)
Someone on a IRC Channel help me to solve it, a little change on the makefile and use a 32 bit compiler instead 64 bit one was the solution.

Can't create QT postgresql plugin for Symbian device

I'm trying to create postgresql plugin for Symbian device but I can't compile it. I'm working on Windows 7 64bit.
I did everything according to this article: http://doc.qt.io/archives/qt-4.7/sql-driver.html#qpsql
C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\psql>qmake "INCLUDEPATH+=C:\Program Files (x86)\PostgreSQL\8.3\include" "LIBS+=C:\Program Files (x86)\PostgreSQL\8.3\lib\libpq.lib" psql.pro
WARNING: (internal):1: Unescaped backslashes are deprecated.
So, it looked OK. Then...
C:\...drivers\psql>C:\QtSDK\Symbian\tools\sbs\win32\mingw\bin\make debug-gcce
sbs -c arm.v5.udeb.gcce4_4_1
python.exe is not recognized as an internal or external command, operable program or batch file.
make: *** [debug-gcce] Error 9009
I noticed, that sbs_home was set to python directory but it was not in the path, then the make could not find the script raptor_start.py:
C:\...drivers\psql>echo %sbs_home%
C:\QtSDK\Symbian\tools\sbs\win32\python27
C:\...drivers\psql>set path=%path%;%sbs_home%
C:\...drivers\psql>C:\QtSDK\Symbian\tools\sbs\win32\mingw\bin\make debug-gcce
sbs -c arm.v5.udeb.gcce4_4_1
python.exe: can't open file C:\QtSDK\Symbian\tools\sbs\win32\python27\python\raptor_start.py': [Errno 2] No such file or directory
make: *** [debug-gcce] Error 2
C:\...drivers\psql>set sbs_home=C:\QtSDK\Symbian\tools\sbs
so, when I started compiling I got this error:
C:/QtSDK/Symbian/SDKs/Symbian3Qt474/epoc32/include/stdapis/stlportv5/stl/_istream.c:650: warning: suggest parentheses around '&&' within '||' target : epoc32\release\armv5\udeb\qsqlpsql.dll [arm.v5.udeb.gcce4_4_1]
FAILED linkandpostlink for arm.v5.udeb.gcce4_4_1: epoc32\release\armv5\udeb\qsqlpsql.dll
mmp: qsqlpsql_dll.mmp
c:/qtsdk/symbian/tools/gcce4/bin/../lib/gcc/arm-none-symbianelf/4.4.1/../../../../arm-none-symbianelf/bin/ld.exe: warning: C:/QtSDK/Symbian/SDKs/Symbian3Qt474/epoc32/release/armv5/udeb/usrt3_1.lib(ucppinit.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
C:/QtSDK/Symbian/SDKs/Symbian3Qt474/epoc32/build/psql/c_8d95259b570e1766/qsqlpsql_dll/armv5/udeb/qsql_psql.o: In function `qMakeError': C:/QtSDK/QtSources/4.8.1/src/sql/drivers/psql/qsql_psql.cpp:175: undefined reference to `PQerrorMessage'
....many undefined references...
C:/QtSDK/QtSources/4.8.1/src/sql/drivers/psql/qsql_psql.cpp:117: undefined reference to `PQfreemem'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [C:/QtSDK/Symbian/SDKs/Symbian3Qt474/epoc32/release/armv5/udeb/qsqlpsql.dll] Error 1
sbs: error: The make-engine exited with errors.
sbs : warnings: 3
sbs : errors: 2
built 'arm.v5.udeb.gcce4_4_1'
Run time 5 seconds
sbs: build log in C:\QtSDK\Symbian\SDKs\Symbian3Qt474\epoc32\build\Makefile.2012-06-26-15-03-12.78-2996.log
make: *** [debug-gcce] Error 1
Has anybody idea, what with it?
You are trying to build an Symbian/ARM application using precompiled binary postgresql client library for Windows. This won't ever work. The instructions you refer to only show how to build for OS X, Unix and Mac targets natively. You're cross compiling for Symbian.
You'd first need to obtain a binary version of the postgresql client library compiled for Symbian. It might exist out there, or you may need to compile it yourself. I don't think that the library supports Symbian as a target, and I couldn't readily find any Symbian ports for download. You may be out of luck for a trivial solution. A port might not be entirely out of the question, though -- perhaps the platform-specific code is localized enough.

Getting started with AspectC++

I do think that some of my problems concerning adding new functionality to old C++ code can be solved elegantly using AOP. Now, my first idea was to download AspectC++ and just start working. However, it doesn't seem to be that simple:
The Visual Studio integration thingy by pure systems has been updated for the last time about 5 years ago, adding support for VS '05. '10 (which I'm using) isn't detected during installation which in turn results in the installation being canceled.
ACDT was updated the last time Feb '07, Eclipse 3.2 being the last one supported, installation on current Eclipse fails.
Simply trying to compile the examples that come with AspectC++ doesn't work either:
username#username-VirtualBox:/media/sf_Temp/aspectc++$ make
make -C examples/coverage
make[1]: Entering directory `/media/sf_Temp/aspectc++/examples/coverage'
Compiling main.cc
make[1]: /media/sf_Temp/aspectc++/ag++: Command not found
make[1]: *** [Junk/main.o] Error 127
make[1]: Leaving directory `/media/sf_Temp/aspectc++/examples/coverage'
make: *** [coverage.make] Error 2
username#username-VirtualBox:/media/sf_Temp/aspectc++$
This "command not found" is weird, as simply running ag++ works (albeit it then of course complains about having no input files).
Soooo ... I'm kind of lost now. Any help on where to find a working manual for performing the first steps or some hint concerning what I'm doing wrong would be appreciated. Or is AspectC++ just too outdated/unusable/whatever for people to use it (which would explain the lack of some simple first-steps-manual which usually can be found by the hundreds)?
Thanks in advance.
I'm the AspectC++ project leader. If you need help, the best way is to subscribe to the AspectC++ user mailing list (visit www.aspectc.org and click on "support") and post a question there. It is not possible to be aware of all questions being posted anywhere on the web. Sorry. Yet, you are really welcome on our mailing list! :-)
In your special case, the error message sounds as if ag++ hadn't found ac++. These two binaries have to reside in the same directory. ag++ is just a wrapper that calls ac++, which performs the actual code transformation, and g++ for the compilation into an object file.