pcxod / olex2

Other
12 stars 0 forks source link

Are there any instructions to build olex2 from source code? #1

Closed SamLukeYes closed 3 years ago

SamLukeYes commented 3 years ago

I didn't find a guide for compiling on the official website. Have I missed something?

pcxod commented 3 years ago

Hello, you can use Visual Studio project or scons script. Scons can be used on Linux and Mac as well. The script will build the same bit-ness as the Python. For example to build 32 bit version, use 32 bit Python:

c:\Python27x32\scripts\scons --wxdir=c:\devel\wxWidgets-3.0.4-vc9 --wxver=30 -j13 you can add --olx_debug option to build a debug version.

Note that you need relevant version of wxWidgets, the default TOOL for Windows is vc9 (2008) compiler, there are settings for up to vc11, extend to new 15/16 as needed.

With the VS solution, you will also need this properties file to be placed next to the solution file: work.props.txt Rename it to work.props and edit the content to set up paths to Python and wxWidgets.

SamLukeYes commented 3 years ago

Hello, you can use Visual Studio project or scons script. Scons can be used on Linux and Mac as well. The script will build the same bit-ness as the Python. For example to build 32 bit version, use 32 bit Python:

c:\Python27x32\scripts\scons --wxdir=c:\devel\wxWidgets-3.0.4-vc9 --wxver=30 -j13 you can add --olx_debug option to build a debug version.

Note that you need relevant version of wxWidgets, the default TOOL for Windows is vc9 (2008) compiler, there are settings for up to vc11, extend to new 15/16 as needed.

With the VS solution, you will also need this properties file to be placed next to the solution file: work.props.txt Rename it to work.props and edit the content to set up paths to Python and wxWidgets.

Thanks for your reply, but there's still something confusing.

My OS is Manjaro Linux, and it seems that the package wxgtk2 provides wxWidgets. How should I specify wxdir, or do I need it? When I run scons2 or scons2 --wxver=30, it shows the following message:

scons: Reading SConscript files ...
Build architecture: 64bit
Building location: build/scons/gnu/release-64bit/py2.7/
Unfortunately could not update the revision information

          Warning: No config found to match: /usr/bin/wx-config --cxxflags --version=2.9 --static=yes --libs std gl
                   in /usr/lib/wx/config
          If you require this configuration, please install the desired
          library build.  If this is part of an automated configuration
          test and no other errors occur, you may safely ignore it.
          You may use wx-config --list to see all configs available in
          the default prefix.

Please make sure that wxWidgets and Python config scripts are available

wx-config --list shows:


    Default config is gtk2-unicode-3.0

  Default config will be used for output

  Alternate matches:
    gtk3-unicode-3.0
pcxod commented 3 years ago

I tells you that it "wants" this: "--version=2.9 --static=yes" But you can edit the SConstruct Python script and drop the requirement or update it with the ones you have or need. Line #287 reads: env.ParseConfig("wx-config --cxxflags --version=2.9 --static=yes --libs std gl") Change it to something like: env.ParseConfig("wx-config --cxxflags --libs std gl")

P.S. Sorry - the version passed on the command line has been ignored for non-Windows builds.

pcxod commented 3 years ago

I have updated the scons script - in general, there is no reason to force specific build for Linux/Mac if people decide to build Olex2 by themselves. There is also the make script which also builds Olex2 but I have never tested its installation functionality.

SamLukeYes commented 3 years ago

@pcxod wx-config is provided by wxgtk2. Can I use wx-config-gtk3 from wxgtk3 instead?

BTW, how to fix this error while making:

/usr/bin/ld: build/scons/gnu/release-64bit/py2.7/olex/xpprocs.o: undefined reference to symbol 'FcConfigAppFontAddDir'
/usr/bin/ld: /usr/lib/libfontconfig.so.1: error adding symbols: DSO missing from command line
pcxod commented 3 years ago

Regarding the ld, check this one out: http://nanapro.org/en-us/forum/index.php?u=/topic/244/hello-world-error-undefined-reference Regarding wx-config - it is a symbolic link so you can direct it to a different config file but also look at its --toolkit option where you can specify gtk3.

SamLukeYes commented 3 years ago

I tried to compile Olex2 with make, worked around some errors with LDFLAGS += -lfontconfig -lpthread -lm -lstdc++, but finally got a sort of errors like this: https://paste.ubuntu.com/p/5MPBVW8wxz/

Should I use scons instead? If so, how should I switch the flags with scons?

pcxod commented 3 years ago

The make output suggests that the wxWidgets libraries did not make it into the linking stage - you have to see what the command line is. With scons - I am not sure why those symbols would be missing but you have this line #288 in current file: env.Append(LIBS=['libGL', 'libGLU']) just try adding them at that line.

SamLukeYes commented 3 years ago

The make output suggests that the wxWidgets libraries did not make it into the linking stage - you have to see what the command line is. With scons - I am not sure why those symbols would be missing but you have this line #288 in current file: env.Append(LIBS=['libGL', 'libGLU']) just try adding them at that line.

I dumped the making output into this log file: make.log Does "the command line" mean line 3285?

Also tried scons with 'libfontconfig' added to line 288, but another sort of strange errors appeared. This is the log dumped when reproducing the errors: scons.log

pcxod commented 3 years ago

I just installed a new Ubuntu and did the following:

  1. sudo apt install git g++ python-dev libwxgtk3.0-dev make libfontconfig1-dev
  2. git clone https://github.com/pcxod/olex2.git
  3. cd olex2
  4. gedit Makefile, add -lfontconfig to the list of libraries
  5. make -j8 - all done

Similar with scons:

  1. sudo apt install scons
  2. gedit SConstruct, add 'fontconfig' and 'dl' libraries to the list
  3. scons -j8 - all done

Please check if you have the development libraries

SamLukeYes commented 3 years ago

I just installed a new Ubuntu and did the following:

  1. sudo apt install git g++ python-dev libwxgtk3.0-dev make libfontconfig1-dev
  2. git clone https://github.com/pcxod/olex2.git
  3. cd olex2
  4. gedit Makefile, add -lfontconfig to the list of libraries
  5. make -j8 - all done

Similar with scons:

  1. sudo apt install scons
  2. gedit SConstruct, add 'fontconfig' and 'dl' libraries to the list
  3. scons -j8 - all done

Please check if you have the development libraries

In general, Arch-based distributions does not split runtime libraries and development libraries into different packages, unless upstream developers divides them into different projects or repositories. I don't think I lack those development libraries.

pcxod commented 3 years ago

As I am concerned - there are no problems compiling Olex2 on Redhat, Debian or Suse with possibly a minor updates to the scripts as discussed above.

From the output you have provided I can see that the linker does not find the libraries to link against (libGl, wxGTK)- thus the errors. Thus is the request to double-check you actually have them installed.

SamLukeYes commented 3 years ago

I managed to finish the make process using a modified Makefile provided here: https://github.com/archlinuxcn/repo/issues/1965#issuecomment-723392292

But make install doesn't work, it says:

make: PROXY: No such file or directory
Installing to local directory:  /home/yes
cp: cannot create regular file '/home/yes/olex/': Not a directory
make: *** [Makefile:271: install] Error 1

If I run olex2 binary directly, it fails with this message:

18:01:52: Warning: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1013,wx containers,compatible with 2.8),
and your program used 3.0 (wchar_t,compiler with C++ ABI 1014,wx containers,compatible with 2.8).
fish: 'src/olex2/bin/olex2' terminated by signal SIGSEGV (Address boundary error)
pcxod commented 3 years ago

As I said - I did not go any further than compilation with make. And regarding the error - I know this error appears when Olex2 is compiled with newer complier than that wxWidgets was compiled with... On Windows I simply recompile wxWidgets with the same version. On Linux you may have to build wxWidgets by yourself as well - this is one of the reasons I use static linking with wx in my builds.

To actually get a fully running Olex2 - you would need to get one of my builds (I guess they do not work for you?), replace the executable and check the lib folder - these are what Olex2 needs. But also look into the start script - in particular regarding the PYHTNOHOME variable.