|
|
Home » Developing U++ » U++ Developers corner » Compile error on Fedora 25 x86_64 (abs redefinition and include that goes wrong?)
|
|
|
|
Re: Compile error on Fedora 25 x86_64 [message #47173 is a reply to message #47169] |
Sun, 25 December 2016 10:14 |
MrSarup
Messages: 30 Registered: December 2016
|
Member |
|
|
Hi Mirek,
mirek wrote on Sun, 25 December 2016 09:45Mostly for my own reference:
[/code]
Your series of commands is time consuming because each time yum is called. This can be simplified in one command with a yes switch "-y" as follows:
yum -y install gtk2-devel pango-devel atk-devel cairo-devel libnotify-devel bzip2-devel xorg-x11-server-devel freetype-devel expat-devel
|
|
|
Re: Compile error on Fedora 25 x86_64 [message #47179 is a reply to message #47163] |
Sun, 25 December 2016 15:19 |
|
amrein
Messages: 278 Registered: August 2008 Location: France
|
Experienced Member |
|
|
Hi Mirek
What is different:
- When you run "make" or "make -j8", it won't use thread to compile because it calls domake.sh and domake.sh doesn't call "make" with the "-jn" switch.
- If you only use one processor in the VM, it will use the "-j1" switch and won't use several threads to compile.
- upp-x11-src-10577M.tar.gz does not need source code fix. It will compile out of the box with the new spec file provided (file attached). This is not the case of the old stable 9251 source tarball and older tarballs.
So the only thing to do is to patch the spec file.
If you want to test rpmbuild to see how it crashes with the old spec file:
sudo dnf install rpm-build
rpmbuild -tb --define 'version 10577M' --define "date $(LC_TIME=En date '+%a %b %d %Y')" upp-x11-src-10577M.tar.gz
If you want to test the new spec file and confirm that it works:
mkdir ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
cp upp-x11-src-10577M.tar.gz ~/rpmbuild/SOURCES/
cp upp.spec ~/rpmbuild/SPECS/
rpmbuild -bb --define 'version 10577M' --define "date $(LC_TIME=En date '+%a %b %d %Y')" ~/rpmbuild/SPECS/upp.spec
"-tb" means build the tarball and get the spec file from inside the tarball.
"-bb" means build the spec file and use the default directory structure to find the tarball.
If you want to find why make crashes with -jn switch:
tar xzvf upp-x11-src-10577M.tar.gz
cd upp-x11-src-10577M
sed -i -e 's|make -C uppsrc|make -j8 -C uppsrc|g' domake
make
make crashes because "make prepare" is not completed before "make $(OutFile)" when using threads (-jn).
I used this to change the spec file and get rpmbuild to compile upp 4x faster.
-
Attachment: upp.spec
(Size: 5.62KB, Downloaded 267 times)
[Updated on: Sun, 25 December 2016 16:23] Report message to a moderator
|
|
|
Re: Compile error on Fedora 25 x86_64 [message #47180 is a reply to message #47179] |
Sun, 25 December 2016 16:54 |
MrSarup
Messages: 30 Registered: December 2016
|
Member |
|
|
Hi amrein,
I have tried this with -tb switch but got errors on Centos 7 64bits, as mentioned here:
http://www.ultimatepp.org/forums/index.php?t=msg&th=9817 &goto=47168&#msg_47168
The upp.spec file you have used has a wrong command in the first line. This may have continued to be in there since a few years.
To extend this I have also tried to use -jn method with make. There is no change.
Regardless of all this, all I want is to compile from reference SocketServer.cpp. As I have misunderstood many things and am a new comer, do I really need to do all this compiling and build the binaries before hand?
I could not even build the SocketServer.cpp and did not know how to build that. As this is not in docs, I need to discover from someone, or continue experimenting.
Could you make a quick suggestion for this?
|
|
|
Re: Compile error on Fedora 25 x86_64 [message #47182 is a reply to message #47180] |
Sun, 25 December 2016 18:49 |
|
amrein
Messages: 278 Registered: August 2008 Location: France
|
Experienced Member |
|
|
What I have found so far:
- Fedora, Redhat and Centos have removed the _desktopdir variable, so upp.spec needed to use "%{_datadir}/applications" instead. This is fixed in the provided upp.spec and has been committed too in svn.
- You build your rpm package as root, am I write? You should build your rpm package with a standard user account.
- Previous stable version of ultimate++ source won't build without manual fix on new linux distributions due to changes in external dependencies. Ultimate++ 10577M snapshot doesn't have this issue and is up to date. Thank to Mirek to point that out.
- Before compiling, you need to install all required devel packages and tools. So as root type:
yum install gtk2-devel pango-devel atk-devel cairo-devel libnotify-devel bzip2-devel xorg-x11-server-devel freetype-devel expat-devel rpm-build gcc-c++
Then to compile upp from source, login using your user account, download upp-x11-src-10577M.tar.gz and upp.spec and type in a terminal:
mkdir ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
cp upp-x11-src-10577M.tar.gz ~/rpmbuild/SOURCES/
cp upp.spec ~/rpmbuild/SPECS/
rpmbuild -bb --define 'version 10577M' --define "date $(LC_TIME=En date '+%a %b %d %Y')" ~/rpmbuild/SPECS/upp.spec
Note :
1. You will be able to build directly from tarball when the new upp.spec will be included in the new snapshot. Tomorrow I guess.
2. If my instructions above don't work on Centos, tell me witch version of Centos so I can test it too and find a solution.
|
|
|
Re: Compile error on Fedora 25 x86_64 [message #47187 is a reply to message #47182] |
Sun, 25 December 2016 21:31 |
MrSarup
Messages: 30 Registered: December 2016
|
Member |
|
|
Hi amrein,
Thanks for your input.
As mentioned in my messages, I have already done all you have described.
I tried on Centos 7 64bits. It cannot build.
Can one compile directly with specific package? If yes, what are the commands then?
I give the following as an example:
g++ -std=c++11 SocketServer.cpp -o SocketServer.bin 2>&1
Then, what are the additional cpp files I need to add to it? I have tried to make the path absolute, instead of being in that directory. It did not work.
I also needed to give absolute paths within the header files as it could not find from relative paths.
To fix and focus on the issue, lets take SocketServer.cpp as an example.
Could you let me know how to compile the SocketServer.cpp into a console application? If you show me the steps, I will be able to come forward.
Thanks.
|
|
|
|
Re: Compile error on Fedora 25 x86_64 [message #47192 is a reply to message #47191] |
Tue, 27 December 2016 10:59 |
MrSarup
Messages: 30 Registered: December 2016
|
Member |
|
|
Hi amrein,
Thanks for confirming the problem I have identified.
But that relates to only rpmbuild if one wants to build the theIDE.
My question to you was building one cpp from example or reference as a console application.
In my above post, I used - as mentioned - SocketServer.cpp.
May I ask you again to tell me steps or commands to build SocketServer.cpp with GCC?
This should not be difficult for people like you to answer.
Moreover, I see that this community is just so tiny and less co-operative that makes me rethink if I should continue spending my time to learn and get into a forked environment of U++.
If the docs are not there or badly written, then a new comer is immediately exposed to mercy of the community. And if the community is tiny, it just does not work anymore.
Thanks
|
|
|
Re: Compile error on Fedora 25 x86_64 [message #47193 is a reply to message #47192] |
Tue, 27 December 2016 12:30 |
|
amrein
Messages: 278 Registered: August 2008 Location: France
|
Experienced Member |
|
|
The issue is really not rpmbuild related. It's a gcc version compatibility issue I guess.
Ultimate++ uses c++ features a lot and upp source code has been fixed to be compatible with last gcc and headers from dependencies.
Compiling just one source file won't resolve the issue. To compile SocketServer.cpp, you need part of the Core library and you won't have Core without fixing those "ambiguous overloaded methods" errors.
When you run make inside upp root directory, you don't just build theide, you build all libraries first.
If you want to build a version of ultimate++ that is compatible with Centos 7, you must use the last (OLD) stable release.
Note :
- I say old because it is based on Redhat and not Fedora.
- I don't know ultimate++ enough to fix the new snapshot source code.
The following instructions will work perfectly on Centos:
- Create rpmbuild directories: mkdir ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
- Install required build dependencies: yum install gtk2-devel pango-devel atk-devel cairo-devel libnotify-devel bzip2-devel xorg-x11-server-devel freetype-devel expat-devel rpm-build gcc-c++ gcc
- Download upp-x11-src-10597M.tar.gz (last snapshot) from here http://www.ultimatepp.org/downloads/upp-x11-src-10597M.tar.gz
- Download upp-x11-src-9251.tar.gz (last stable release) from sourceforge https:// sourceforge.net/projects/upp/files/upp/2015.2/upp-x11-src-92 51.tar.gz/download
- Uncompress upp-x11-src-10597M.tar.gz (snapshot)
- Copy upp.spec from the uncompressed upp-x11-src-10597M/ directory into ~/rpmbuild/SPECS/
- Copy upp-x11-src-9251.tar.gz (stable release) into ~/rpmbuild/SOURCES/
- Build upp: rpmbuild -bb --define 'version 9251' --define "date $(LC_TIME=En date '+%a %b %d %Y')" ~/rpmbuild/SPECS/upp.spec
As you can see, my instructions from my first post do work for the stable release.
And if you don't want to build rpm but just want to compile ultimate++:
- Install required build dependencies: yum install gtk2-devel pango-devel atk-devel cairo-devel libnotify-devel bzip2-devel xorg-x11-server-devel freetype-devel expat-devel rpm-build gcc-c++ gcc
- Download upp-x11-src-9251.tar.gz (last stable release) from sourceforge https:// sourceforge.net/projects/upp/files/upp/2015.2/upp-x11-src-92 51.tar.gz/download
- Uncompress upp-x11-src-9251.tar.gz (last stable release)
- Change dir to upp-x11-src-9251
- Build upp with just: make
|
|
|
Goto Forum:
Current Time: Wed Jun 05 09:16:47 CEST 2024
Total time taken to generate the page: 0.02759 seconds
|
|
|