Boost logo

Boost-Build :

Subject: [Boost-build] Use of path-constant cygwin vs VSCommand Prompt
From: Brian Davis (bitminer_at_[hidden])
Date: 2009-04-02 20:43:26


I have the following Jamroot file below and I have been noticing a
difference between MSVC command prompt and Cygwin (gcc).

I have two questions with this post:

1) What is the dealy-o with path-constant where locals are involved in the
path and what is the difference (besides the obvious syntax difference
between ms and cygwin path/directory syntax)?

2) Why does bjam swap between use of cygwin paths and dos paths in the build
when in the cygwin environment building for toolset msvc

Help, as always, is greatly appreciated

==========================================

import property ;
import generators ;
import os ;
import toolset : flags ;
import feature : get-values ;
import type ;
import common ;
import package ;
import nvcc ;
import user-config ;

path-constant TOP : . ;

local HOSTNAME = [ modules.peek : HOSTNAME ] ;
local USER = [ modules.peek : USER ] ;
local PATH = [ modules.peek : PATH ] ;

path-constant THIRD_PARTY_SRC : source/3rdParty/Win32 ;

local BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;

local BOOST_ROOT = $(THIRD_PARTY_SRC)/boost/boost_1_38_0 ;
#local BOOST_ROOT = $(THIRD_PARTY_SRC)/boost/boost_1_37_0 ;
#local BOOST_ROOT = $(THIRD_PARTY_SRC)/boost/boost_1_36_0 ;
#local BOOST_ROOT = $(THIRD_PARTY_SRC)/boost/boost_1_34_0 ;

path-constant NVIDIA_SDK : "$(THIRD_PARTY_SRC)/cuda-2.1/NVIDIA
Corporation/NVIDIA\ CUDA\ SDK" ;
path-constant CUDA_SDK : "$(THIRD_PARTY_SRC)/cuda-2.1/CUDA" ;
echo "NVIDIA_SDK = $(NVIDIA_SDK)" ;

echo "1" ;

#echo "PREFIX = $(PREFIX) " ;

echo "PATH = $(PATH)" ;
echo "BOOST_ROOT = $(BOOST_ROOT)" ;

echo "2" ;

path-constant INSTALL_ROOT_DIR : "install/$(HOSTNAME)" ;

echo "3" ;

path-constant INSTALL_DEBUG_BIN : $(INSTALL_ROOT_DIR)/debug/bin ;

echo "4" ;

path-constant INSTALL_DEBUG_LIB : $(INSTALL_ROOT_DIR)/debug/lib ;

echo "5" ;

path-constant INSTALL_RELEASE_BIN : $(INSTALL_ROOT_DIR)/release/bin ;

echo "6" ;
path-constant INSTALL_RELEASE_LIB : $(INSTALL_ROOT_DIR)/release/lib ;

use-project boost : $(BOOST_ROOT) ;

use-project /nvidia_sdk : $(NVIDIA_SDK)/build ;
use-project /cuda_sdk : $(CUDA_SDK)/build ;
use-project /Win32 : source/common/Win32/build ;

use-project /test : source/common/test/build ;

build-project /cuda_sdk ;
build-project /nvidia_sdk ;
build-project /test ;

project 3D_DSA
    : requirements
        <include>$(NVIDIA_SDK)/common/inc
        <include>boost <threading>multi

        <search>$(NVIDIA_SDK)/common/lib
# <architecture>x86
        <toolset>msvc:<target-os>windows <define>YUPPERS
# <toolset>gcc:<target-os>windows

    : usage-requirements

    : build-dir build/$(HOSTNAME)
# : default-build debug <toolset>msvc <target-os>windows
    ;

alias install
    :
        /test_cases/boosttest//install
    :

    ;

explicit install ;

==========================================
Below is the output from cygwin
$ bjam
warning: escape sequences are not supported
warning: this will cause major misbehaviour on cygwin
warning: your version of bjam is likely out of date
warning: please get a fresh version from SVN.
NVCC Generator is being initialized
1 : nvcc.nvcc
2 : CU
3 : OBJ
4 :
NVIDIA_SDK =
/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/cuda-2.1/NVIDIA
Corporation/NVIDIA CUDA SDK
1
PATH =
/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_37_0/tools/jam/src/bin.cygwinx86
PATH = /usr/local/bin PATH = /usr/bin PATH = /bin PATH = /usr/X11R6/bin PATH
= /cygdrive/c/WINDOWS/system32 PATH = /cygdrive/c/WINDOWS PATH =
/cygdrive/c/WINDOWS/System32/Wbem PATH = /cygdrive/c/Program Files/Common
Files/GTK/2.0/bin PATH = /cygdrive/c/Program Files/QuickTime/QTSystem/ PATH
= /cygdrive/c/msys/1.0 PATH = /cygdrive/c/msys/1.0/bin PATH =
/cygdrive/c/Program Files/Microsoft SQL Server/90/Tools/binn/ PATH =
/cygdrive/c/Program Files/TortoiseSVN/bin PATH = /cygdrive/c/Program
Files/ATI Technologies/ATI.ACE/Core-Static PATH = /cygdrive/c/CUDA/bin PATH
= /cygdrive/c/Program Files/IMSI/FloorPlan 3D v8/Program PATH =
/usr/X11R6/bin PATH = /usr/X11R6/bin PATH = /usr/lib/lapack
BOOST_ROOT =
/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0
2
3
4
5
6
7
8
9
10
11
12
13
at nvidia_sdk
at cuda-2.1
at Win32
at test_cases
warning: No toolsets are configured.
warning: Configuring default toolset "gcc".
warning: If the default is wrong, your build may not work correctly.
warning: Use the "toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning:
http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html

...patience...
...found 1753 targets...
...updating 7 targets...
common.copy
/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/install/badboy/debug/lib/glut32.lib
gcc.compile.c++
build/badboy/source/common/test/simpleBoostTest/build/gcc-3.4.4/debug/threading-multi/boosttest.o
gcc.link
build/badboy/source/common/test/simpleBoostTest/build/gcc-3.4.4/debug/threading-multi/boosttest
common.copy
/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/install/badboy/debug/bin/boost_system-gcc34-mt-d-1_38.so
common.copy
/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/install/badboy/debug/bin/boost_filesystem-gcc34-mt-d-1_38.so
common.copy
/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/install/badboy/debug/bin/boost_thread-gcc34-mt-d-1_38.so
common.copy
/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/install/badboy/debug/bin/boosttest
...updated 7 targets...

==========================================

Below is the output from VS command prompt:

E:\projects\boost\MyNotes\BjamOrBSquare\ProjectX>bjam
NVCC Generator is being initialized
1 : nvcc.nvcc
2 : CU
3 : OBJ
4 :
NVIDIA_SDK =
E:\projects\boost\MyNotes\BjamOrBSquare\ProjectX\source\3rdParty\Win32\cuda-2.1\NVIDIA
Corporation\NVIDIA CUDA SDK
1

BOOST_ROOT =
E:\projects\boost\MyNotes\BjamOrBSquare\ProjectX\source\3rdParty\Win32/boost/boost_1_38_0
2
3
4
5
6
7
8
9
10
11
12
E:/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/tools/build/v2/build\project.jam:636:
in object(project-attributes)@15.set
*** argument error
* rule path.make ( native )
* called with: ( )
* missing argument native
E:/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/tools/build/v2/util\path.jam:44:see
definition of rule 'make' being called
E:/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/tools/build/v2/build\project.jam:905:
in project
Jamroot:98: in modules.load
E:/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/tools/build/v2/build\project.jam:313:
in load-jamfile
E:/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/tools/build/v2/build\project.jam:62:
in load
E:/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/tools/build/v2/build\project.jam:168:
in project.find
E:/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/tools/build/v2\build-system.jam:535:
in load
E:\projects\boost\MyNotes\BjamOrBSquare\ProjectX\source\3rdParty\Win32\boost\boost_1_38_0\tools\build\v2/kernel\modules.jam:283:
in import
E:\projects\boost\MyNotes\BjamOrBSquare\ProjectX\source\3rdParty\Win32\boost\boost_1_38_0\tools\build\v2\kernel\bootstrap.jam:138:
in boost-build
E:\projects\boost\MyNotes\BjamOrBSquare\ProjectX\boost-build.jam:2: in
module scope

So likely the issue is in the build-dir
    : build-dir build/$(HOSTNAME)

as $(HOSTNAME) is a local not a path constant. Are locals allowed here? If
not can one convert from local to path-constant?

if I make the change:

#local HOSTNAME = [ modules.peek : HOSTNAME ] ;
path-constant HOSTNAME : hostname ;

It works, which is not what I want... but it works. Why the difference
between cygwin and msvc

=============================================================================

Now Question 2: In building in cygwin for msvc with:

-d+2 toolset=msvc target-os=windows debug

Why does bjam swap between use of cygwin paths and dos paths in the build

as in actions:

/out:"e:\projects\boost\MyNotes\BjamOrBSquare\ProjectX\source\3rdParty\Win32\boost\boost_1_38_0\bin.v2\libs\system\build\msvc-9.0express\debug\target-os-windows\threading-multi\boost_system-vc90-mt-gd-1_38.dll"

and in modules

'/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/system/build/msvc-9.0express/debug/target-os-windows/threading-multi/error_code.obj';

It's half way there!

=============================================================================
Excerpt from full build below

"/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/system/build/msvc-9.0express/debug/target-os-windows/threading-multi/error_code.obj"

msvc.link.dll
/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/system/build/msvc-9.0express/debug/target-os-windows/threading-multi/boost_system-vc90-mt-gd-1_38.dll

        cmd.exe /S /C call "C:\Program Files\Microsoft Visual Studio
9.0\VC\vcvarsall.bat" x86 ">nul" "&&" link /NOLOGO /INCREMENTAL:NO /DLL
/DEBUG /subsystem:console
/out:"e:\projects\boost\MyNotes\BjamOrBSquare\ProjectX\source\3rdParty\Win32\boost\boost_1_38_0\bin.v2\libs\system\build\msvc-9.0express\debug\target-os-windows\threading-multi\boost_system-vc90-mt-gd-1_38.dll"
/IMPLIB:"e:\projects\boost\MyNotes\BjamOrBSquare\ProjectX\source\3rdParty\Win32\boost\boost_1_38_0\bin.v2\libs\system\build\msvc-9.0express\debug\target-os-windows\threading-multi\boost_system-vc90-mt-gd-1_38.lib"
@"e:\projects\boost\MyNotes\BjamOrBSquare\ProjectX\source\3rdParty\Win32\boost\boost_1_38_0\bin.v2\libs\system\build\msvc-9.0express\debug\target-os-windows\threading-multi\boost_system-vc90-mt-gd-1_38.dll.rsp"

LINK : warning LNK4044: unrecognized option
'/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/system/build/msvc-9.0express/debug/target-os-windows/threading-multi/error_code.obj';
ignored

=============================================================================
Full build

**** Build of configuration Debug for project ProjectArea51 ****

bjam -d+2 toolset=msvc target-os=windows debug
NVCC Generator is being initialized
1 : nvcc.nvcc
2 : CU
3 : OBJ
4 :
NVIDIA_SDK =
/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/cuda-2.1/NVIDIA
Corporation/NVIDIA CUDA SDK
1
PATH =
/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/tools/jam/src/bin.cygwinx86
PATH = /usr/bin PATH = /cygdrive/c/Program Files/Java/jre6/bin/client PATH =
/cygdrive/c/Program Files/Java/jre6/bin PATH =
/cygdrive/e/projects/Quantumspex/projects/3D_DSA/source/3rdParty/Win32/boost/boost_1_38_0/tools/jam/src/bin.cygwinx86
PATH = /usr/local/bin PATH = /usr/X11R6/bin PATH = . PATH =
/cygdrive/c/WINDOWS/system32 PATH = /cygdrive/c/WINDOWS PATH =
/cygdrive/c/WINDOWS/System32/Wbem PATH = /cygdrive/c/Program Files/Common
Files/GTK/2.0/bin PATH = /cygdrive/c/Program Files/QuickTime/QTSystem/ PATH
= /cygdrive/c/msys/1.0 PATH = /cygdrive/c/msys/1.0/bin PATH =
/cygdrive/c/Program Files/Microsoft SQL Server/90/Tools/binn/ PATH =
/cygdrive/c/Program Files/TortoiseSVN/bin PATH = /cygdrive/c/Program
Files/ATI Technologies/ATI.ACE/Core-Static PATH = /cygdrive/c/CUDA/bin PATH
= /cygdrive/c/Program Files/IMSI/FloorPlan 3D v8/Program PATH =
/usr/lib/lapack
BOOST_ROOT =
/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0
2
3
4
5
6
7
8
9
10
11
12
13
at nvidia_sdk
at cuda-2.1
at Win32
at test_cases
************************************************************
Trying to build Boost.Thread with pthread support.
If you need pthread you should specify the paths.
You can specify them in site-config.jam, user-config.jam
or in the environment.
For example:
PTW32_INCLUDE=C:\Program Files\ptw32\Pre-built2\include
PTW32_LIB=C:\Program Files\ptw32\Pre-built2\lib
************************************************************
Skipping build of:
/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/libs/thread/build/boost_thread
<build>no in common properties

file
e:\projects\boost\MyNotes\BjamOrBSquare\ProjectX\source\3rdParty\Win32\boost\boost_1_38_0\bin.v2\libs\system\build\msvc-9.0express\debug\target-os-windows\threading-multi\boost_system-vc90-mt-gd-1_38.dll.rsp

"/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/system/build/msvc-9.0express/debug/target-os-windows/threading-multi/error_code.obj"

msvc.link.dll
/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/system/build/msvc-9.0express/debug/target-os-windows/threading-multi/boost_system-vc90-mt-gd-1_38.dll

        cmd.exe /S /C call "C:\Program Files\Microsoft Visual Studio
9.0\VC\vcvarsall.bat" x86 ">nul" "&&" link /NOLOGO /INCREMENTAL:NO /DLL
/DEBUG /subsystem:console
/out:"e:\projects\boost\MyNotes\BjamOrBSquare\ProjectX\source\3rdParty\Win32\boost\boost_1_38_0\bin.v2\libs\system\build\msvc-9.0express\debug\target-os-windows\threading-multi\boost_system-vc90-mt-gd-1_38.dll"
/IMPLIB:"e:\projects\boost\MyNotes\BjamOrBSquare\ProjectX\source\3rdParty\Win32\boost\boost_1_38_0\bin.v2\libs\system\build\msvc-9.0express\debug\target-os-windows\threading-multi\boost_system-vc90-mt-gd-1_38.lib"
@"e:\projects\boost\MyNotes\BjamOrBSquare\ProjectX\source\3rdParty\Win32\boost\boost_1_38_0\bin.v2\libs\system\build\msvc-9.0express\debug\target-os-windows\threading-multi\boost_system-vc90-mt-gd-1_38.dll.rsp"

LINK : warning LNK4044: unrecognized option
'/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/system/build/msvc-9.0express/debug/target-os-windows/threading-multi/error_code.obj';
ignored
LINK : warning LNK4001: no object files specified; libraries used
LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup_at_12
e:\projects\boost\MyNotes\BjamOrBSquare\ProjectX\source\3rdParty\Win32\boost\boost_1_38_0\bin.v2\libs\system\build\msvc-9.0express\debug\target-os-windows\threading-multi\boost_system-vc90-mt-gd-1_38.dll
: fatal error LNK1120: 1 unresolved externals
...skipped
<p/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/filesystem/build/msvc-9.0express/debug/target-os-windows/threading-multi>boost_filesystem-vc90-mt-gd-1_38.dll
for lack of
<p/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/system/build/msvc-9.0express/debug/target-os-windows/threading-multi>boost_system-vc90-mt-gd-1_38.lib...
...skipped
<p/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/filesystem/build/msvc-9.0express/debug/target-os-windows/threading-multi>boost_filesystem-vc90-mt-gd-1_38.lib
for lack of
<p/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/system/build/msvc-9.0express/debug/target-os-windows/threading-multi>boost_system-vc90-mt-gd-1_38.lib...
...skipped
<pbuild/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/hostname/source/common/test/simpleBoostTest/build/msvc-9.0express/debug/build-no/target-os-windows/threading-multi>boosttest.exe
for lack of
<p/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/system/build/msvc-9.0express/debug/target-os-windows/threading-multi>boost_system-vc90-mt-gd-1_38.lib...
...skipped
<p/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/install/hostname/debug/bin>boost_system-vc90-mt-gd-1_38.dll
for lack of
<p/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/system/build/msvc-9.0express/debug/target-os-windows/threading-multi>boost_system-vc90-mt-gd-1_38.dll...
...skipped
<p/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/install/hostname/debug/bin>boost_system-vc90-mt-gd-1_38.lib
for lack of
<p/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/system/build/msvc-9.0express/debug/target-os-windows/threading-multi>boost_system-vc90-mt-gd-1_38.lib...
...skipped
<p/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/install/hostname/debug/bin>boost_filesystem-vc90-mt-gd-1_38.dll
for lack of
<p/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/filesystem/build/msvc-9.0express/debug/target-os-windows/threading-multi>boost_filesystem-vc90-mt-gd-1_38.dll...
...skipped
<p/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/install/hostname/debug/bin>boost_filesystem-vc90-mt-gd-1_38.lib
for lack of
<p/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/source/3rdParty/Win32/boost/boost_1_38_0/bin.v2/libs/filesystem/build/msvc-9.0express/debug/target-os-windows/threading-multi>boost_filesystem-vc90-mt-gd-1_38.lib...
...skipped
<p/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/install/hostname/debug/bin>boosttest.exe
for lack of
<pbuild/cygdrive/e/projects/boost/MyNotes/BjamOrBSquare/ProjectX/hostname/source/common/test/simpleBoostTest/build/msvc-9.0express/debug/build-no/target-os-windows/threading-multi>boosttest.exe...
...failed updating 2 targets...

-- 
Brian J. Davis
Microsoft Windows !!! Worlds best Linux installer.  Comes preinstalled on
almost all computers.  Provides the ability to download, burn and install
Linux in one easy to use package!  Boot the PC, download your favorite ISO,
burn, and reboot.  Just 4 easy steps and your running Linux in no time!
 Provides excellent networking support to download your favorite distro
fast.  Get your copy today!!!


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk