|
Bugzilla – Full Text Bug Listing |
| Summary: | OSX --enable-static unimplemented: code model large not supported in PIC mode | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | John Abraham <john.abraham.in> |
| Component: | core | Assignee: | Mathieu Lacage <mathieu.lacage> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | gjcarneiro, ns-bugs, tomh |
| Priority: | P5 | ||
| Version: | pre-release | ||
| Hardware: | Mac Intel | ||
| OS: | Mac OS | ||
| Attachments: | Config.log | ||
The relevant code is in src/wscript:
elif module.env['CXX_NAME'] in ['gcc', 'icc'] and \
os.uname()[4] == 'x86_64' and \
module.env['ENABLE_PYTHON_BINDINGS']:
# enable that flag for static builds only on x86-64 platforms
# when gcc is present and only when we want python bindings
# (it's more efficient to not use this option if we can avoid it)
cxxflags = ['-mcmodel=large']
ccflags = ['-mcmodel=large']
I suspect that it should be safe to add an extra check for darwin here.
Wouldn't this be the case in not just darwin but also others which do not support mcmodel==large? (In reply to comment #1) > > The relevant code is in src/wscript: > > elif module.env['CXX_NAME'] in ['gcc', 'icc'] and \ > os.uname()[4] == 'x86_64' and \ > module.env['ENABLE_PYTHON_BINDINGS']: > # enable that flag for static builds only on x86-64 platforms > # when gcc is present and only when we want python bindings > # (it's more efficient to not use this option if we can avoid it) > cxxflags = ['-mcmodel=large'] > ccflags = ['-mcmodel=large'] > > > I suspect that it should be safe to add an extra check for darwin here. The issue persists on the RC2 image as well. Perhaps we could keep this bug open and make a darwin specific change and deal with this post-ns-3.12 (In reply to comment #2) > Wouldn't this be the case in not just darwin but also others which do not > support mcmodel==large? > > > (In reply to comment #1) > > > > The relevant code is in src/wscript: > > > > elif module.env['CXX_NAME'] in ['gcc', 'icc'] and \ > > os.uname()[4] == 'x86_64' and \ > > module.env['ENABLE_PYTHON_BINDINGS']: > > # enable that flag for static builds only on x86-64 platforms > > # when gcc is present and only when we want python bindings > > # (it's more efficient to not use this option if we can avoid it) > > cxxflags = ['-mcmodel=large'] > > ccflags = ['-mcmodel=large'] > > > > > > I suspect that it should be safe to add an extra check for darwin here. just add an extra argument to the if statement to check if you are on linux. author John Abraham <john.abraham@gatech.edu> Fri Aug 26 17:06:35 2011 -0400 (40 seconds ago) changeset 7467 936cb356fb09 parent 7466 d23a92c90eee Will need to investigate this further 1. What specific feature or requirement of ns-3 needs mcmodel==large 2. Some google-searching indicates there may be a performance impact in using mcmode==large.We need some way make some measurements to justify that. > 1. What specific feature or requirement of ns-3 needs mcmodel==large the static build needs it on 64bit systems because the compiler tends to generate binaries that use 64bit displacements. > 2. Some google-searching indicates there may be a performance impact in using > mcmode==large.We need some way make some measurements to justify that. yes, the large model is slower than the small and medium models but there is no way to avoid using it on a 64bit box if you want to use static linking. given the outcome of bug 1253, is this test in src/wscript obsolete now and should be removed? elif module.env['CXX_NAME'] in ['gcc', 'icc'] and \ os.uname()[4] == 'x86_64' and \ sys.platform != 'darwin' and \ module.env['ENABLE_PYTHON_BINDINGS']: # enable that flag for static builds only on x86-64 platforms # when gcc is present and only when we want python bindings # (it's more efficient to not use this option if we can avoid it) cxxflags = ['-mcmodel=large'] ccflags = ['-mcmodel=large'] cxxdefines = ["NS3_MODULE_COMPILATION"] ccdefines = ["NS3_MODULE_COMPILATION"] (In reply to comment #7) > given the outcome of bug 1253, is this test in src/wscript obsolete now and > should be removed? I would think so (In reply to comment #8) > (In reply to comment #7) > > given the outcome of bug 1253, is this test in src/wscript obsolete now and > > should be removed? > > I would think so Removed. |
Created attachment 1226 [details] Config.log This works on OSX when cloning ns-3-dev. However the following steps do not work for the RC1 build 44 cp /Users/john/Downloads/ns-allinone-3.12-RC1.tar.bz2 /Users/john/ns-3/ns-3.12/ 45 cd /Users/john/ns-3/ns-3.12/ 46 ls 47 tar -xvjpf ns-allinone-3.12-RC1.tar.bz2 48 cd ns-allinone-3.12-RC1 52 cd ns-3.12-RC1/ 53 ./waf -d debug configure --enable-static 54 ./waf [ 596/1279] gen-module-header: build/debug/ns3/gnuplot.h build/debug/ns3/delay-jitter-estimation.h build/debug/ns3/average.h build/debug/ns3/event-garbage-collector.h -> build/debug/ns3/tools-module.h [ 597/1279] gen-module-header: build/debug/ns3/pyviz.h -> build/debug/ns3/visualizer-module.h [ 598/1279] gen-module-header: build/debug/ns3/point-to-point-grid.h build/debug/ns3/point-to-point-dumbbell.h build/debug/ns3/point-to-point-star.h -> build/debug/ns3/point-to-point-layout-module.h [ 599/1279] gen-module-header: build/debug/ns3/csma-star-helper.h -> build/debug/ns3/csma-layout-module.h [ 600/1279] cxx: src/core/model/unix-system-condition.cc -> build/debug/src/core/model/unix-system-condition_2.o ../src/core/model/unix-system-condition.cc:1: sorry, unimplemented: code model large not supported in PIC mode ../src/core/model/unix-system-condition.cc:1: error: code model ‘large’ not supported in the 64 bit mode Waf: Leaving directory `/Users/john/ns-3/ns-3.12/ns-allinone-3.12-RC1/ns-3.12-RC1/build' Build failed: -> task failed (err #1): {task: cxx unix-system-condition.cc -> unix-system-condition_2.o} config.log is attached