CMK_PIC was not properly set and used in charmc.
authorGengbin Zheng <gzheng@illinois.edu>
Tue, 19 Oct 2010 15:38:20 +0000 (10:38 -0500)
committerGengbin Zheng <gzheng@illinois.edu>
Tue, 19 Oct 2010 15:38:20 +0000 (10:38 -0500)
CMK_PIC defined in conv-machs is only available after running conv-config.sh in charmc.

src/arch/mpi-darwin-ppc/cc-xlc.sh
src/arch/net-darwin-ppc/cc-xlc.sh
src/arch/net-linux-ppc/cc-gcc64.sh
src/scripts/charmc
src/scripts/conv-config.sh

index 80d16a39f8a873a2c4115423cd3b7ecfb3e107ba..13b4d84ad310fe04dbfb485d54cc5a3f21a0b3e6 100644 (file)
@@ -1,6 +1,7 @@
 CMK_CC="xlc_r -qnocommon -qpic "
 #CMK_CXX="xlc++_r "
-CMK_CXX="xlc++_r -qnocommon -qpic "
+CMK_PIC="-qpic"
+CMK_CXX="xlc++_r -qnocommon "
 CMK_LD="$CMK_CC -qnofullpath "
 CMK_LDXX="$CMK_CXX -qnofullpath "
 CMK_C_OPTIMIZE="-O3 -qstrict -Q  "
index affc84b1a3c84c8b5dcdbd3ad577d354bdd8a4d5..fbb058824e29ed5745b81587f68f4ccae60e6a4d 100644 (file)
@@ -1,6 +1,7 @@
-CMK_CC="xlc_r -qnocommon -qpic "
+CMK_PIC="-qpic"
+CMK_CC="xlc_r -qnocommon "
 #CMK_CXX="xlc++_r "
-CMK_CXX="xlc++_r -qnocommon -qpic "
+CMK_CXX="xlc++_r -qnocommon "
 CMK_LD="$CMK_CC -qnofullpath "
 CMK_LDXX="$CMK_CXX -qnofullpath "
 CMK_C_OPTIMIZE="-O3 -qstrict -Q  "
index db39cbdeee3b9a897d973ff334fa3df915eafc36..96ccfba0aad078196add1514809ea1e18d2b45c1 100644 (file)
@@ -1,9 +1,10 @@
 CMK_64bit=" -m64 "
+CMK_PIC="-fpic"
 
 CMK_CPP_CHARM="/lib/cpp -P"
 CMK_CPP_C="gcc -E"
-CMK_CC="gcc $CMK_64bit -fPIC "
-CMK_CXX="g++ $CMK_64bit -fPIC "
+CMK_CC="gcc $CMK_64bit "
+CMK_CXX="g++ $CMK_64bit "
 CMK_CXXPP="$CMK_CXX -x c++ -E "
 CMK_RANLIB="ranlib"
 CMK_LIBS="-lckqt"
index cc85da4a50d8fcd00487f9953b301b1b7e7e9992..143d1effb97288ae7025ca36c47da55a9a62c973 100755 (executable)
@@ -49,8 +49,8 @@ OPTS_CXX=""
 OPTS_F90=""
 OPTS_LD=""  
 OPTS_LDXX=""
-OPTS_PIC="$CMK_PIC"
-test -z "$OPTS_PIC" && OPTS_PIC='-fpic'
+OPTS_PIC=""
+USE_PIC="0"
 
 CHARMDEBUG=""
 LINK_PYTHON=""
@@ -482,18 +482,12 @@ do
        
        "-swapglobal"|"-swapglobals")
                SWAPGLOBALS="1"
-               OPTS_CC="$OPTS_CC $OPTS_PIC"
-               OPTS_CXX="$OPTS_CXX $OPTS_PIC"
-               OPTS_F90="$OPTS_F90 $OPTS_PIC"
-               OPTS_LD="$OPTS_LD $OPTS_PIC"
+               USE_PIC="1"
                ;;
 
        "-copyglobal"|"-copyglobals")
                SWAPGLOBALS="2"
-               OPTS_CC="$OPTS_CC $OPTS_PIC"
-               OPTS_CXX="$OPTS_CXX $OPTS_PIC"
-               OPTS_F90="$OPTS_F90 $OPTS_PIC"
-               OPTS_LD="$OPTS_LD $OPTS_PIC"
+               USE_PIC="1"
                ;;
 
        "-tlsglobal"|"-tlsglobals")
@@ -870,6 +864,15 @@ then
        fi
 fi
 
+OPTS_PIC="$CMK_PIC"
+if [ "$USE_PIC" = "1" ]
+then
+       OPTS_CC="$OPTS_CC $OPTS_PIC"
+       OPTS_CXX="$OPTS_CXX $OPTS_PIC"
+       OPTS_F90="$OPTS_F90 $OPTS_PIC"
+       OPTS_LD="$OPTS_LD $OPTS_PIC"
+fi
+
 if [ "$BUILD_SHARE" = "1" ]
 then
        # ignore BUILD_SHARE if the target is not .a or .so
index 652b6e9658bd3277ac374f90af906b8b28918868..cf9352ee59bf7e706827789f6f901369a3874615 100644 (file)
@@ -81,6 +81,8 @@ then
   fi
 fi
 
+[ -z "$CMK_PIC" ] && CMK_PIC='-fpic'
+
 [ -z "$CMK_SEQ_CC" ] && CMK_SEQ_CC="$CMK_CC"
 [ -z "$CMK_SEQ_CXX" ] && CMK_SEQ_CXX="$CMK_CXX"
 [ -z "$CMK_SEQ_LD" ] && CMK_SEQ_LD="$CMK_LD"