Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Compile error on Fedora 25 x86_64 (abs redefinition and include that goes wrong?)
icon4.gif  Compile error on Fedora 25 x86_64 [message #47153] Thu, 22 December 2016 18:47 Go to next message
amrein is currently offline  amrein
Messages: 278
Registered: August 2008
Location: France
Experienced Member
Hi

When I compile upp from source in Fedora 25 x86_64, I have several issues:

In upp-x11-src-9251/uppsrc/Core/Core.h
* Those two methods are refined (according to the compiler) and the compiler will stop with errors:
- inline UPP::int64 abs(UPP::int64 x)
- inline double abs(double x)

In upp-x11-src-9251/uppsrc/CtrlCore/GtkDrawText.cpp
* The included file "ftoutln.h" is not the one from Fedora default freetype include directory and the compiler complains about duplicate definitions then stop with errors.
- #include <plugin/FT_fontsys/ftoutln.h>

In upp-x11-src-9251/upp.spec (my own file)
* The mutithread compilation won't work because of missing objects files when compiling upp source with threads. The uppsrc/Makefile is not thread safe.
- make %{?_smp_mflags}

* We need to prevent rpmbuild to create debug package or it will fail
+ %define debug_package %{nil}

To conclude, all modifications are needed for the upp.spec file but for Core.h and GtkDrawText.cpp, I'm quite sure that you will find a better solution than just commenting those lines.

I uploaded patch.diff for you to find the files and lines I'm talking about.
Regards
  • Attachment: patch.diff
    (Size: 3.03KB, Downloaded 229 times)
Re: Compile error on Fedora 25 x86_64 [message #47162 is a reply to message #47153] Sat, 24 December 2016 08:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Not yet sure how to fix abs (that one is horribly incompatible between compiler versions), but maybe ftoutln include can be fixed by conditioning the include with

#ifndef __FTOUTLN_H__
#include <plugin/FT_fontsys/ftoutln.h>
#endif
Re: Compile error on Fedora 25 x86_64 [message #47163 is a reply to message #47162] Sat, 24 December 2016 16:41 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Weird... I have downloaded Fedora 25 into VM, downloaded nightly tarball, installed packages (I do not know how to run .spec, so manually) and everything built without problems without changing anything (all I did was make).

What can be different?

Mirek
Re: Compile error on Fedora 25 x86_64 [message #47169 is a reply to message #47163] Sun, 25 December 2016 09:45 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mostly for my own reference:

sudo yum install gtk2-devel
sudo yum install pango-devel
sudo yum install atk-devel
sudo yum install cairo-devel
sudo yum install libnotify-devel
sudo yum install bzip2-devel
sudo yum install xorg-x11-server-devel
sudo yum install freetype-devel
sudo yum install expat-devel
make
Re: Compile error on Fedora 25 x86_64 [message #47173 is a reply to message #47169] Sun, 25 December 2016 10:14 Go to previous messageGo to next message
MrSarup
Messages: 30
Registered: December 2016
Member
Hi Mirek,
mirek wrote on Sun, 25 December 2016 09:45
Mostly 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 Go to previous messageGo to next message
amrein is currently offline  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 256 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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
amrein is currently offline  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 Go to previous messageGo to next message
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 #47191 is a reply to message #47187] Tue, 27 December 2016 10:34 Go to previous messageGo to next message
amrein is currently offline  amrein
Messages: 278
Registered: August 2008
Location: France
Experienced Member
On Fedora 25 it will work as expected:
wget -N http://www.ultimatepp.org/downloads/upp-x11-src-10597M.tar.gz
rpmbuild -tb --define 'version 10597M' --define "date $(LC_TIME=En date '+%a %b %d %Y')" upp-x11-src-10597M.tar.gz

On Centos 7 64bit (fresh install from "CentOS-7-x86_64-DVD-1611.iso" with all updates), I get the same error as you do.
It's not packaging related but source code related. If you just decompress the tarball and then type "make", you will get the same errors ("error call of overloaded 'Sort(Upp::Vector<int>&)' is ambiguous").
wget -N http://www.ultimatepp.org/downloads/upp-x11-src-10597M.tar.gz
tar zxvf upp-x11-src-10597M.tar.gz
cd upp-x11-src-10597M
make

I'm not sure but I guess that it's gcc version related, and for that, I have no solution:

* Centos 7 : gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
* Fedora 25: gcc (GCC) 6.2.1 20160916 (Red Hat 6.2.1-2)
Re: Compile error on Fedora 25 x86_64 [message #47192 is a reply to message #47191] Tue, 27 December 2016 10:59 Go to previous messageGo to next message
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 Go to previous message
amrein is currently offline  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
Previous Topic: Are there any plans to convert U++ comments to format as DOXYGEN / JAVADOC?
Next Topic: Requirement Spellvariant -> new Feature for spelling
Goto Forum:
  


Current Time: Fri Mar 29 00:09:47 CET 2024

Total time taken to generate the page: 0.01393 seconds