MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001924VCMIOtherpublic2014-10-31 09:392022-04-12 09:17
Reporterjosch 
Assigned ToMixaill 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinux x86_64OSDebianOS Version8.0
Product Version 
Target VersionFixed in Version0.97b 
Summary0001924: vcmi in git fails to build from source on Linux
DescriptionWhen I try to build vcmi from git (develop branch) on Debian Linux I run into:

[ 41%] Building CXX object AI/FuzzyLite/fuzzylite/CMakeFiles/fl-static.dir/src/Console.cpp.o
In file included from /home/josch/vcmi/AI/FuzzyLite/fuzzylite/./fl/Console.h:28:0,
                 from /home/josch/vcmi/AI/FuzzyLite/fuzzylite/src/Console.cpp:25:
/home/josch/vcmi/AI/FuzzyLite/fuzzylite/./fl/fuzzylite.h:33:26: fatal error: ../../Global.h: No such file or directory
 #include "../../Global.h"
                          ^
compilation terminated.
AI/FuzzyLite/fuzzylite/CMakeFiles/fl-static.dir/build.make:57: recipe for target 'AI/FuzzyLite/fuzzylite/CMakeFiles/fl-static.dir/src/Console.cpp.o' failed
make[2]: *** [AI/FuzzyLite/fuzzylite/CMakeFiles/fl-static.dir/src/Console.cpp.o] Error 1
CMakeFiles/Makefile2:494: recipe for target 'AI/FuzzyLite/fuzzylite/CMakeFiles/fl-static.dir/all' failed
make[1]: *** [AI/FuzzyLite/fuzzylite/CMakeFiles/fl-static.dir/all] Error 2
Makefile:136: recipe for target 'all' failed
make: *** [all] Error 2

Why is the line '#include "../../Global.h"' even needed? It seems to build fine without it. If this line is needed for other platforms than linux (it was apparently included in a commit that added MSVS support) then maybe there is a way to let it build with MSVS through a different change? The problem with having this line is, that this change connot be forwarded to fuzzylite upstream. If the fuzzylite version embedded in vcmi could instead be changed such that the changes can be forwarded to fuzzylite upstream, then maybe vcmi can drop their embedded copy in the future.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0005043)
josch (developer)
2014-10-31 09:44

There is a second reason why vcmi in git currently fails to build from source. After having removed the #include line mentioned in my original report, I ran into the following second problem:

[ 94%] Building CXX object AI/VCAI/CMakeFiles/VCAI.dir/Fuzzy.cpp.o
Linking CXX shared library libVCAI.so
/usr/bin/ld.bfd.real: ../FuzzyLite/fuzzylite/bin/libfuzzylite-static.a(IntegralDefuzzifier.cpp.o): relocation R_X86_64_32S against `_ZTVN2fl19IntegralDefuzzifierE' can not be used when making a shared object; recompile with -fPIC
../FuzzyLite/fuzzylite/bin/libfuzzylite-static.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
AI/VCAI/CMakeFiles/VCAI.dir/build.make:247: recipe for target 'AI/VCAI/libVCAI.so' failed
make[2]: *** [AI/VCAI/libVCAI.so] Error 1
CMakeFiles/Makefile2:760: recipe for target 'AI/VCAI/CMakeFiles/VCAI.dir/all' failed
make[1]: *** [AI/VCAI/CMakeFiles/VCAI.dir/all] Error 2
Makefile:136: recipe for target 'all' failed
make: *** [all] Error 2

It seems that the same commit that introduced the #include also removed the lines that add -fPIC to the COMPILE_FLAGS if built on UNIX. But without -fPIC, fuzzylite does not build on linux. Why was this removed? Since it was a conditional, platform dependent statement in AI/FuzzyLite/fuzzylite/CMakeLists.txt, why did it have to be removed for MSVS support?
(0005049)
Warmonger (administrator)
2014-11-01 08:00

If you are on Linux and it doesn't work for you, then you fix it. I didn't see or touch any flags.
(0005051)
josch (developer)
2014-11-01 08:26

Your commit c87f2cda with subject "Updated build for MSVS. Some compile fixes to FuzzyLite source." removed the conditional set_target_properties which set the COMPILE_FLAGS on unix in the file AI/FuzzyLite/fuzzylite/CMakeLists.txt.

I have no problem creating patches that fix the issues, but I first wanted to discuss this issue with you because otherwise my fixes for linux will not make it work on windows. Thus it would need to know the reason for your changes that made it fail to compile for me as I described above. Only then will it be possible to come up with a solution that works on both platforms at the same time.
(0005057)
Mixaill (developer)
2014-11-01 18:19
edited on: 2014-11-01 21:25

Should be fixed in Pull Request 49 https://github.com/vcmi/vcmi/pull/49 [^]

(0005058)
Mixaill (developer)
2014-11-02 10:15

Fixed in git

- Issue History
Date Modified Username Field Change
2014-10-31 09:39 josch New Issue
2014-10-31 09:44 josch Note Added: 0005043
2014-11-01 08:00 Warmonger Note Added: 0005049
2014-11-01 08:26 josch Note Added: 0005051
2014-11-01 18:19 Mixaill Note Added: 0005057
2014-11-01 18:19 Mixaill Note Edited: 0005057 View Revisions
2014-11-01 21:25 Mixaill Note Edited: 0005057 View Revisions
2014-11-02 10:15 Mixaill Note Added: 0005058
2014-11-02 10:16 Mixaill Status new => resolved
2014-11-02 10:16 Mixaill Fixed in Version => 0.dev
2014-11-02 10:16 Mixaill Resolution open => fixed
2014-11-02 10:16 Mixaill Assigned To => Mixaill
2014-12-25 13:34 Warmonger Status resolved => new
2014-12-25 13:34 Warmonger Status new => resolved
2014-12-25 13:34 Warmonger Fixed in Version 0.dev => 0.97b
2022-04-12 09:17 Povelitel Status resolved => closed

Site | Forums | Wiki | Slack | GitHub


Copyright © 2000 - 2024 MantisBT Team
Hosting provided by DigitalOcean