Skip to content

[REQUEST] How to compile SP build #401

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

Closed
NosferatuJoe opened this issue May 26, 2021 · 35 comments
Closed

[REQUEST] How to compile SP build #401

NosferatuJoe opened this issue May 26, 2021 · 35 comments
Labels

Comments

@NosferatuJoe
Copy link

Since the latest available SP download is months old I would love a feature where someone could beta test the latest SP version available on github. As a programming newb myself, it's kind of hard to find how to use the latest commit build on github.
As far as I understand I have to compile it in Linux since I'm running a linux CSGO server. BUT I've never ran a linux distro nor do I understand how I need to do this. Is there an easier way or atleast a guide on how to do this?

I'm requesting this because some commits contain potential fixes for problems that I'm having.

@srpg
Copy link
Contributor

srpg commented May 27, 2021

There is Guide to compile yourself a build.

@NosferatuJoe
Copy link
Author

Thanks for the heads-up. I tried to build SP on ubuntu 20.04 using virtualbox & on windows but I can't seem to get it to work. On ubuntu I struggled with installing GCC since you have to build that yourself and I'm a rookie with linux/ubuntu. Also on windows I installed all prerequirements and when I select the game it just doesn't do anything in the "cmd" window, nor does it create the files in the builds/windows/csgo/, it's just empty.

So now I'm kind of stuck since there is no specific guide on how to do all this. I'm not a computer dummy and mostly I find stuff myself but this is harder than I thought.

@Ayuto Ayuto added the question label Jun 6, 2021
@Ayuto
Copy link
Member

Ayuto commented Jun 6, 2021

There are no beta builds for SP. We had a buildbot in the past that created a new release for every single GitHub commit and preserved the last 10 or 50 builds, but unfortunately we don't have that hosted server anymore. Instead, the buildbot is now running on a local virtual machine that has to be triggered manually.

To help you with building SP yourself I would need a little bit more information (e. g. the output of your cmd window).

Btw. I will create a new release today.

@NosferatuJoe
Copy link
Author

First of all thank you so much for the update. According to my server cpu & ram usage, our WCS mod seems to run a lot better. Not sure if it's due to the update but I haven't done any changes besides it. CPU usage is stable around 40-50% while previously it would be 60% on idle and spike to 90-100%.

Also regarding the beta builds, isn't it possible to add a buildbot on github using "Actions"? Not sure if it's free and hard to implement, and besides that it would just be a convenience thing.

PS: Ya'll forgot to change the copyright date in "sp info" command, it still says 2019-2020.

@Ayuto
Copy link
Member

Ayuto commented Jun 22, 2021

Thanks for the heads up! I have updated the copyright date.

I don't think GitHub Actions has enough hardware resources in the free version. CPU time and disk space is very limited and probably wouldn't suffice for compiling all Source.Python configurations.

@NosferatuJoe
Copy link
Author

NosferatuJoe commented Jul 1, 2021

Thanks for the heads up! I have updated the copyright date.

I don't think GitHub Actions has enough hardware resources in the free version. CPU time and disk space is very limited and probably wouldn't suffice for compiling all Source.Python configurations.

Fair enough. I'm not sure how to check, if the cost isn't that steep I might want to cover the cost of it.

@NosferatuJoe
Copy link
Author

NosferatuJoe commented Sep 24, 2021

Could someone please make a video on how I can compile a build in Linux/Ubuntu? I tried it using the guide but it didn't work and I'm a noob at linux. I would even pay for someone to make a short video on how to do it. I can't wrap my head around it, it seems so simple in the guide but it doesn't work for me and I tried to install the versions which are specified..

I also wondered, if I compile on Windows that's only for .dll right?

@srpg

@NosferatuJoe NosferatuJoe changed the title [FEATURE REQUEST] SP beta builds or guide on how to compile [REQUEST] How to compile SP build Sep 24, 2021
@srpg
Copy link
Contributor

srpg commented Sep 25, 2021

I haven't been able compile SP build on windows.
I can't test Linux, since my computer only have windows.

@NosferatuJoe
Copy link
Author

@srpg Do you have experience with compiling SP build on Linux/Ubuntu? I'm willing to pay for a tutorial video or detailed explanation since I can't get it to work.. I have like zero experience with Linux so the guide online is kind of very basic..

@srpg
Copy link
Contributor

srpg commented Sep 25, 2021

I don't have experience with compile SP build on Linux. I can't try it since i don't have any Linux computer.

@NosferatuJoe
Copy link
Author

@srpg I tried it using ubuntu on virtual machine but I can't get my head around it. It isn't really easy without a decent step-by-step guide for a beginner linux user

@srpg
Copy link
Contributor

srpg commented Sep 25, 2021

I just tried aswell in linux but couldn't make work, but i just did manage make build from windows, after i got help from @CookStar to solve the issue not able to compile files.

@Ayuto
Copy link
Member

Ayuto commented Sep 25, 2021

Where exactly are you stucking? What's the output of your terminal? And why do you want to compile it yourself?

@NosferatuJoe
Copy link
Author

I will reinstall ubuntu on a virtual machine and try to compile SP again and give you the output of the terminal.

I want to compile it myself so I can test out any new commits, because sometimes they contain useful fixes for me. I also like to test the latest commits before an official build is released, since there is no release history on the http://downloads.sourcepython.com/ page. There is only one build available and if, for whatever reason, that build doesn't work with your plugins, you're kind of fucked..

@Ayuto
Copy link
Member

Ayuto commented Sep 26, 2021

The previous version is also available. If you install Ubuntu, try Ubuntu 16. It still has the older GCC versions.

@NosferatuJoe
Copy link
Author

@Ayuto Where can I find a previous version? And thanks for the hint, I'll try to compile it with Ubuntu 16 instead.

@srpg
Copy link
Contributor

srpg commented Oct 1, 2021

@Ayuto i tried to compile on linux at virtual machine but everytime i try to compile a new build it gives me these errors:

mitja@mitja-VirtualBox:~$ '/home/mitja/Työpöytä/Source.Python-master/src/Build.sh'
Choose the branch you wish to build against:

/home/mitja/Työpöytä/Source.Python-master/src/Build.sh: 20: cd: can't cd to makefiles/branch
-e (1) .vboxclient-clipboard
-e (2)
-e (3)
-e (4)
-e (5)
-e (6) .vboxclient-seamless
-e (7) .vboxclient-display-svga-x11
-e (8) .vboxclient-draganddrop
-e (9)

Do you have any clue what causes that error? I would normaly compile at my windows computer, but linux server doesn't work with the build i make on windows.

@satoon101
Copy link
Member

You're currently in your home (~) directory, so when it tries to cd into the relative makefiles/branch directory, it's literally trying to cd into ~/makefiles/branch, which likely won't exist. Instead, you should just need to cd into the directory containing the Build.sh file and then execute it, ie:

cd /home/mitja/Työpöytä/Source.Python-master/src
sh Build.sh

@CookStar
Copy link
Contributor

CookStar commented Oct 1, 2021

Useful commands:
(cd /home/mitja/Työpöytä/Source.Python-master/src/ && ./Build.sh)
or
(cd /home/mitja/Työpöytä/Source.Python-master/src/ && ./Build.sh css)

@srpg
Copy link
Contributor

srpg commented Oct 1, 2021

I still fail to compile build in linux.
mitja@mitja-VirtualBox:$ cd /home/mitja/Työpöytä/Source.Python-master/src
mitja@mitja-VirtualBox:
/Työpöytä/Source.Python-master/src$ '/home/mitja/Työpöytä/Source.Python-master/src/Build.sh'
Choose the branch you wish to build against:

-e (1) tf2
-e (2) css
-e (3) csgo
-e (4) blade
-e (5) l4d2
-e (6) bms
-e (7) gmod
-e (8) dods
-e (9) hl2dm

2
/home/mitja/Työpöytä/Source.Python-master/src/Build.sh: 58: Bad substitution
mitja@mitja-VirtualBox:~/Työpöytä/Source.Python-master/src$

I also tried those commands and didn't work

@CookStar
Copy link
Contributor

CookStar commented Oct 1, 2021

Try bash Build.sh.

@srpg
Copy link
Contributor

srpg commented Oct 1, 2021

Still fails to build, here is the log from it
build.log
.

@CookStar
Copy link
Contributor

CookStar commented Oct 1, 2021

Still fails to build, here is the log from it build.log .

It seems multilib is missing. Also, you will need an older version of GCC(4.8 recommended). #413 (comment)
http://wiki.sourcepython.com/contributing/building.html#linux

Edit:
This may be helpful.
https://stackoverflow.com/questions/4643197/missing-include-bits-cconfig-h-when-cross-compiling-64-bit-program-on-32-bit

@srpg
Copy link
Contributor

srpg commented Oct 1, 2021

I have issue to download older version of GCC.
When i try:
mitja@mitja-VirtualBox:~$ sudo apt-get install gcc-4.8
[sudo] password for mitja:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package gcc-4.8 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'gcc-4.8' has no installation candidate

I also tried build from source, but i didn't manage to do it

@Ayuto
Copy link
Member

Ayuto commented Oct 14, 2021

Have you tried Ubuntu 16 as mentioned above? It should be available.

@srpg
Copy link
Contributor

srpg commented Oct 14, 2021

Have you tried Ubuntu 16 as mentioned above? It should be available.

I haven't try that, tomorrow will try it.
Will in Ubuntu 16 work sudo apt-get install gcc-4.8 to download or does it have to compile manually?

@srpg
Copy link
Contributor

srpg commented Oct 15, 2021

I tried with Ubuntu 16, still came issues
It shows: CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/core.dir/all' failed
make[1]: *** [CMakeFiles/core.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
./Build.sh: 152: ./Build.sh: Bad substitution
mitja@mitja-VirtualBox:~$
Here is the build log
build.log
.

@Ayuto
Copy link
Member

Ayuto commented Nov 6, 2021

Sorry for the late reply. It looks like it's still compiling with 5.4. Please try setting the path to the 4.8 version:

CXX=/usr/bin/g++-4.8

@srpg
Copy link
Contributor

srpg commented Nov 6, 2021

Sorry for the late reply. It looks like it's still compiling with 5.4. Please try setting the path to the 4.8 version:

CXX=/usr/bin/g++-4.8

Where i need to set the path?
Some reason it tries with 5.4, even i have installed 4.8 version.

@Ayuto
Copy link
Member

Ayuto commented Nov 7, 2021

Just set it in you terminal right before calling the build script.

@srpg
Copy link
Contributor

srpg commented Nov 7, 2021

It still seem to compile with 5.4 version. Even i did set it CXX=/usr/bin/g++-4.8 in terminal.

@NosferatuJoe
Copy link
Author

I'm interested in this. @srpg Did you eventually get it working?

@srpg
Copy link
Contributor

srpg commented Nov 17, 2021

@NosferatuJoe I didn't get it work, i just don't get why it tries compile with 5.4 version even set the path to 4.8.
I am pretty close to solve it, the compile part is anymore remaining issue for me

@Ayuto
Copy link
Member

Ayuto commented Dec 4, 2021

It still seem to compile with 5.4 version. Even i did set it CXX=/usr/bin/g++-4.8 in terminal.

I forgot to mention that you also need to export the variable:
export CXX
Alternatively, you can also set it inside of the script.

Please also make sure the path exists on your system.

@srpg
Copy link
Contributor

srpg commented Dec 10, 2021

Now i got it compile, thanks for the help!

@Ayuto Ayuto closed this as completed Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants