Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes for linking editor on linux #111

Merged
merged 15 commits into from
Nov 17, 2023
Merged

Conversation

IkerGalardi
Copy link
Contributor

@IkerGalardi IkerGalardi commented Sep 13, 2023

This PR adds several changes in order to advance on the editor being linked and hopefully runable. The next are the main changes:

  • Change to use system headers on the linux environment rather that using the repository included ones.
  • Minor fixes with certain library instalations
  • Disabling audio related code on linux installs
  • Enable dynamic linking on linux

It is also important to note that the build environment's freeimage library is missing the Utilities.h header and it's functions, so maybe freeimage should be also compiled on the environment like Compressonator?

In order to use the docker environment, first build the image by using the next command:

docker buildx build build_scripts/ -t spartanbuildenv

Then you can either enter the container and simply use the shell as normal or just run make on the container and exit:

docker run -v $(pwd):/code -w /code/ -it spartanbuildenv      # Enter the container on the repository folder
docker run -v $(pwd):/code -w /code/ -it spartanbuildenv make # Run make inside the container and exit out of the container 

#66

The package mesa-vulkan-drivers does not really include any header files
as header files are only included on *-dev packages.
Using system headers on linux is simpler for system libraries, as those
don't need to be copied to the repository, updating manually...

Using the same headers for linux and windows can be a problem as some
headers have specific configurations per platform. Using the system
headers on linux removes this configuration issue as the distro
(ubuntu in this case) has already a correct configuration.
Those don't exist as far as I know, so simply use the production
library. Distros like fedora include `debug-info` packages, so maybe
installing those could help the later gdb debugging. That should be
investigated for ubuntu.
Static linking can be a bit tricky on linux (or unix based system's in
general).

WARNING: this commit changes the configuration also for windows as the
build script gets a bit cluttered by the `if os.target() ==...` on
definitions and library kind.
FMOD is not currently available on the linux build environment, so all
sound related code gets disabled.

NOTE: This will be a temporal fix as for now I just wan't to get the runtime
and editor running.
@IkerGalardi IkerGalardi marked this pull request as ready for review September 15, 2023 13:45
@IkerGalardi IkerGalardi changed the title Link the editor Some fixes for linking editor Sep 15, 2023
@IkerGalardi
Copy link
Contributor Author

IkerGalardi commented Sep 15, 2023

Hopefully the error is related with dynamic linking 🤞

This will be my last PR in some time. So for anyone that want's to follow this work I would recommend on fixing the FreeImage realted issues, and finish adding the last libraries to the environment. Linking errors should then be resolved and if there is no undefined behavior or linux vulkan driver specific issues the engine should run just fine.

Hopefully I can be back soon 😊

@IkerGalardi IkerGalardi changed the title Some fixes for linking editor Some fixes for linking editor on linux Sep 15, 2023
@PanosK92
Copy link
Owner

Appreciate the work you do, no worries, leave this PR with me, I'll go through it soon

@PanosK92
Copy link
Owner

I'll have to do some work before merging this, linking should remain static for Windows

@IkerGalardi
Copy link
Contributor Author

I've done the fixes.

I have a couple of free days so I'll put the PR in draft and try to get FreeImage issues solved.

@IkerGalardi IkerGalardi marked this pull request as draft September 29, 2023 07:36
Ubuntu's version of FreeImage lacked symbols for the `Utilities.h`
functions inside the library binary and the header itself.

Additionally, when certain libraries need patches (like with freeimage),
an additional folder has been created on the build script directory to
hold all the necessary patch files.
@IkerGalardi
Copy link
Contributor Author

I'll open it for review/merge. I'll do the follow up work when I have time!

@IkerGalardi IkerGalardi marked this pull request as ready for review October 7, 2023 14:29
@PanosK92
Copy link
Owner

Linking seems to work fine on Windows again, merging, thanks!

@PanosK92 PanosK92 merged commit be088b2 into PanosK92:master Nov 17, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants