Raised This Month: $32 Target: $400
 8% 

Build/Compile SourceMod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 06-30-2015 , 12:53   Build/Compile SourceMod
Reply With Quote #1

Ciao guys,

I would like to compile SourceMod myself, so I followed Building SourceMod wiki and everything was fine until the Configuring step.
I don't use MozillaBuild and in Requirements-3 I didn't find a vcvars.bat but vcvars32.bat (I hope that's OK).

This is my attempt to run configure script
PHP Code:
PS D:\alliedmodders\sourcemod\buildpython ../configure.py
Traceback 
(most recent call last):
  
File "../configure.py"line 36in <module>
    
run.Configure()
  
File "D:\Python27\lib\site-packages\ambuild2\frontend\prep.py"line 121in Configure
    
if not builder.generate():
  
File "D:\Python27\lib\site-packages\ambuild2\frontend\base\gen.py"line 274in generate
    self
.parseBuildScripts()
  
File "D:\Python27\lib\site-packages\ambuild2\frontend\base\gen.py"line 183in parseBuildScripts
    self
.evalScript(root)
  
File "D:\Python27\lib\site-packages\ambuild2\frontend\base\gen.py"line 243in evalScript
    exec
(codenew_vars)
  
File "D:\alliedmodders\sourcemod\AMBuildScript"line 489in <module>
    
SM.detectSDKs()
  
File "D:\alliedmodders\sourcemod\AMBuildScript"line 115in detectSDKs
    raise Exception
('Could not find a valid path for {0}'.format(sdk.envvar))
ExceptionCould not find a valid path for HL2SDKDODS 
and this is my alliedmodders directory:
Code:
Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         30.6.2015     18:29            ambuild
d----         30.6.2015     18:29            hl2sdk-csgo
d----         30.6.2015     18:27            hl2sdk-proxy-repo
d----         30.6.2015     18:06            mmsource-1.10
d----         30.6.2015     18:09            mysql-5.0.24a-win32
d----         30.6.2015     18:30            sourcemod
Can you help me out guys?
KissLick is offline
psychonic

BAFFLED
Join Date: May 2008
Old 06-30-2015 , 12:59   Re: Build/Compile SourceMod
Reply With Quote #2

You only have the csgo SDK, but are trying to build for all games.

Add --sdks=csgo to your configure.py args.

Edit: alternatively, --sdks=present to build against all SDKs that are found (which would still be just csgo in this case).

Last edited by psychonic; 06-30-2015 at 13:03.
psychonic is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 06-30-2015 , 13:30   Re: Build/Compile SourceMod
Reply With Quote #3

Now it gave me another error :-(
PHP Code:
PS D:\alliedmodders\sourcemod\buildpython ../configure.py --sdks=present
Checking CC compiler 
(vendor test msvc)... ['cl''test.c''-o''test.exe''-nologo''-showIncludes']
not found
Checking CC compiler 
(vendor test gcc)... ['cl''test.c''-o''test.exe']
not found
Traceback 
(most recent call last):
  
File "../configure.py"line 36in <module>
    
run.Configure()
  
File "D:\Python27\lib\site-packages\ambuild2\frontend\prep.py"line 121in Configure
    
if not builder.generate():
  
File "D:\Python27\lib\site-packages\ambuild2\frontend\base\gen.py"line 274in generate
    self
.parseBuildScripts()
  
File "D:\Python27\lib\site-packages\ambuild2\frontend\base\gen.py"line 183in parseBuildScripts
    self
.evalScript(root)
  
File "D:\Python27\lib\site-packages\ambuild2\frontend\base\gen.py"line 243in evalScript
    exec
(codenew_vars)
  
File "D:\alliedmodders\sourcemod\AMBuildScript"line 490in <module>
    
SM.configure()
  
File "D:\alliedmodders\sourcemod\AMBuildScript"line 153in configure
    cxx 
builder.DetectCompilers()
  
File "D:\Python27\lib\site-packages\ambuild2\frontend\base\gen.py"line 103in DetectCompilers
    self
.compiler self.generator.detectCompilers().clone()
  
File "D:\Python27\lib\site-packages\ambuild2\frontend\amb2\gen.py"line 205in detectCompilers
    self
.base_compiler detect.DetectCxx(os.environself.options)
  
File "D:\Python27\lib\site-packages\ambuild2\frontend\cpp\detect.py"line 56in DetectCxx
    cc 
DetectCxxCompiler(env'CC')
  
File "D:\Python27\lib\site-packages\ambuild2\frontend\cpp\detect.py"line 97in DetectCxxCompiler
    raise Exception
('Unable to find a suitable ' + var + ' compiler')
ExceptionUnable to find a suitable CC compiler 
Couldn't that be because of that vcvars.bat ?
KissLick is offline
psychonic

BAFFLED
Join Date: May 2008
Old 06-30-2015 , 13:38   Re: Build/Compile SourceMod
Reply With Quote #4

Quote:
Originally Posted by KissLick View Post
Couldn't that be because of that vcvars.bat ?
Yes. You need to run from a Visual Studio Command Prompt or run the vcvars32.bat to set up the environment.
psychonic is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 06-30-2015 , 14:07   Re: Build/Compile SourceMod
Reply With Quote #5

I tried to run vcvars32.bat from both Developer Command Prompt for VS2013 and PowerShell.
But I till have the same error with python ../configure.py --sdks=present :-(
KissLick is offline
psychonic

BAFFLED
Join Date: May 2008
Old 06-30-2015 , 14:10   Re: Build/Compile SourceMod
Reply With Quote #6

Quote:
Originally Posted by KissLick View Post
I tried to run vcvars32.bat from both Developer Command Prompt for VS2013 and PowerShell.
But I till have the same error with python ../configure.py --sdks=present :-(
What is the exact error when running from Developer Command Prompt for VS2013? (Running from that prompt has the correct environment with vcvars already run. You don't need to manually run it in there.)
psychonic is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 06-30-2015 , 15:24   Re: Build/Compile SourceMod
Reply With Quote #7

Oh! Thank you so much! :-D

I didn't know I have to compile (ambuild command) from Developer Command Prompt for VS2013 :-)

EDIT: Looks like ambuild works now from PowerShell too.

Last edited by KissLick; 06-30-2015 at 15:39.
KissLick is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 06-30-2015 , 18:56   Re: Build/Compile SourceMod
Reply With Quote #8

As a random but relevant question, what exactly is the advantage of compiling SM yourself versus using the pre-compiled snapshots on the main SM page? (If there is any.)
Potato Uno is offline
Lannister
Veteran Member
Join Date: Apr 2015
Old 06-30-2015 , 19:48   Re: Build/Compile SourceMod
Reply With Quote #9

Maybe you could delete that "sm plugins" command with your re-compiled version
Lannister is offline
psychonic

BAFFLED
Join Date: May 2008
Old 06-30-2015 , 20:52   Re: Build/Compile SourceMod
Reply With Quote #10

Quote:
Originally Posted by Lannister View Post
Maybe you could delete that "sm plugins" command with your re-compiled version
If you're not cool with transparency, sharing, and community, you're in the wrong place.
psychonic is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode