Archive for Avizo modules

Linux Modules Compilation

I came to a dead end on the mac because Avizo requires Qt 3.3.6 and Leopard is not consistent with that version. I could not get the moc compiler to work. I tried the moc compiler of qt 4.4 and also tried to compile the moc compiler for 3.3.7 (no success).

I am now working on linux. First i changed Shawn’s method of dealing with include files. I created in mylineset/, an include/ directory with subdirectory hxlines/. I use #include . This approach ensures that I do not need to modify the include structure of the original Amira source, which will simplify integration into Amira later on. I no longer have include files in mylineset/ . In the GNUMakefile, I must put full path of the include directory location. Do not know why.

Everything compiled ok (I had to apply moc compiler by hand).

When starting Avizox (development version), I get errors related to the resource file. Do not know why.

Comments

GNUMakefile and Qt

qt-mac-free-3.3.7.tar.gz could not be compiled on Leopard. I am trying 3.3.8, uploaded to the Trolltech site in 2008, so might be more current (qt-mac-free-3.3.8b.tar.gz).

Equally bad. When running ./configure, I get
Creating qmake. Please wait…
c++ -c -o project.o -pipe -DQT_MACOSX_VERSION= -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -I/Users/erlebach/Documents/src/qt-mac-free-3.3.8b/include/qmake -I/Users/erlebach/Documents/src/qt-mac-free-3.3.8b/include -I/Users/erlebach/Documents/src/qt-mac-free-3.3.8b/include -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/Users/erlebach/Documents/src/qt-mac-free-3.3.8b/mkspecs/macx-g++ -DHAVE_QCONFIG_CPP project.cpp
In file included from /Users/erlebach/Documents/src/qt-mac-free-3.3.8b/include/qtl.h:45,
from /Users/erlebach/Documents/src/qt-mac-free-3.3.8b/include/qvaluelist.h:45,
from /Users/erlebach/Documents/src/qt-mac-free-3.3.8b/include/qstringlist.h:45,
from project.h:42,
from project.cpp:39:
/Users/erlebach/Documents/src/qt-mac-free-3.3.8b/include/qglobal.h:190:6: error: #error “This version of Mac OS X is unsupported”
make: *** [project.o] Error 1
qmake failed to build. Aborting.

——–

Comments

Avizo Makefiles

I included a collection of include files provided by Shawn. that greatly reduced the numer of errors.
I also had to add -msse to the CXXFLAGS in Avizo500.app/Contents/MacOS/makearch-MacX.cfg to prevent SSE errors.

More errors:
from /Users/erlebach/Documents/src/avizo_local/src/mylines/HxLineSetEditor.cpp:146:
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:255: error: ?~@~X__m128i?~@~Y does not name a type

In file included from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h:32,
from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:125,
from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:24,
from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20,
from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/AGL.framework/Headers/agl.h:23,
from /Applications/Avizo500.app/Contents/MacOS/include/Amira/hxgl.h:46,
from /Applications/Avizo500.app/Contents/MacOS/include/Amira/HxViewer.h:66,
from /Users/erlebach/Documents/src/avizo_local/src/mylines/HxLineSetEditor.cpp:146:
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:255: error: ?~@~X__m128i?~@~Y does not name a type

MORE:
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/CarbonEventsCore.h:1763: error: conflicting declaration ?~@~Xtypedef struct __EventLoopTimer* EventLoopTimerRef?~@~Y
/Users/erlebach/Documents/src/avizo_local/shawn/qt/qwindowdefs.h:94: error: ?~@~XEventLoopTimerRef?~@~Y has a previous declaration as ?~@~Xtypedef struct OpaqueEventLoopTimerRef* EventLoopTimerRef?~@~Y

These errors relate to the graphic subsystem on the mac (at least the Carbon-related ones do). These will be hard to deal with.

Conflicting variables (multiply defined):

from /Users/erlebach/Documents/src/avizo_local/src/mylines/HxLineSetEditor.cpp:146:
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Menus.h:807: error: conflicting declaration ?~@~Xtypedef struct OpaqueMenuRef* MenuRef?~@~Y
/Users/erlebach/Documents/src/avizo_local/shawn/qt/qwindowdefs.h:96: error: ?~@~XMenuRef?~@~Y has a previous declaration as ?~@~Xtypedef struct OpaqueMenuHandle* MenuRef?~@~Y

I will simply comment out the variable in qtwindowdefs.h for now. A better solution would be better #ifdefs.

OK, no more conflicting variables. Errors are decreasing. More …

In file included from /Applications/Avizo500.app/Contents/MacOS/include/Amira/HxMain.h:50,
from /Users/erlebach/Documents/src/avizo_local/src/mylines/HxLineSetEditor.cpp:139:
/Users/erlebach/Documents/src/avizo_local/shawn/qt/qmenubar.h:174: error: ?~@~XMenuRef?~@~Y has not been declared
/Users/erlebach/Documents/src/avizo_local/shawn/qt/qmenubar.h:175: error: ?~@~XMenuRef?~@~Y does not name a type
/Users/erlebach/Documents/src/avizo_local/shawn/qt/qmenubar.h:184: error: ?~@~XMenuRef?~@~Y has not been declared
/Users/erlebach/Documents/src/avizo_local/shawn/qt/qmenubar.h:187: error: ?~@~XMenuRef?~@~Y has not been declared
/Users/erlebach/Documents/src/avizo_local/shawn/qt/qmenubar.h:188: error: ?~@~XMenuRef?~@~Y has not been declared

Perhaps the error is different
MenuRef has not been declared. I am searching.

// Notice my changes in shawn/qtwindows.h

#if defined(Q_WS_MAC)
#if QT_MACOSX_VERSION < 0x1020
// typedef struct OpaqueEventLoopTimerRef* EventLoopTimerRef; // GE (in Carbon include files)
// in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/CarbonEventsCore.h:

// from /Users/erlebach/Documents/src/avizo_local/src/mylines/HxLineSetEditor.cpp:146:
// Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Menus.h:807: error: conflicting declaration ?~@~Xtypedef struct OpaqueMenuRef* MenuRef?~@~Y
// /Users/erlebach/Documents/src/avizo_local/shawn/qt/qwindowdefs.h:96: error: ?~@~XMenuRef?~@~Y has a previous declaration as ?~@~Xtypedef struct OpaqueMenuHandle* MenuRef?~@~Y

//typedef struct OpaqueMenuHandle *MenuRef; // ORIG
typedef struct OpaqueMenuRef* MenuRef; // GE (to avoid conflict) in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Menus.h
#else
//typedef struct __EventLoopTimer* EventLoopTimerRef; // GE
typedef struct OpaqueMenuRef* MenuRef;
#endif

========

Final error for HxLineSetEditor.cpp

In file included from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h:32,
from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:125,
from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:24,
from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20,
from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/AGL.framework/Headers/agl.h:23,
from /Applications/Avizo500.app/Contents/MacOS/include/Amira/hxgl.h:46,
from /Applications/Avizo500.app/Contents/MacOS/include/Amira/HxViewer.h:66,
from /Users/erlebach/Documents/src/avizo_local/src/mylines/HxLineSetEditor.cpp:146:/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:255: error: ?~@~X__m128i?~@~Y does not name a type/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:256: error: ?~@~X__m128d?~@~Y does not name a type

I included in HxLineSetEditor.cpp (had no effect)
// GE for Mac only (related to SSE vectorized library)
#include // GE
SHould have worked since this include file defines __m128i

—–
Solution: enable sse2 and not ss3 (-msse2 on the g++ compiler). I found this using the “locate” command in linux/OSX. I found the definition in /usr/local/lib/gcc/i386-apple-darwin9.0.0/4.3.0/include/mmintrin.h . __m128i is a “long long”.
——
Makefile works all the way up to using the moc compiler, which is assumed to be in
/Applications/Avizo500.app/Contents/MacOS/bin/arch-MacX-Optimize
It is not. Therefore, I did: sudo ln -s /usr/bin/moc, and I hope this will work.

The moc compiler for qt4.4 appers to require “include for it to work. This is no in the original include files provided by Shawn.

I need a version of moc for Qt 3.3.6, otherwise I will not be able to compile. The way QObject includes has changed.

I want to install qt manually; otherwise, it might mix incorrectly with current version (4.4).
3.3.6 versions of Qt cannot even be found on the Trolltech website. I did find it there, under “previous versions”: ftp://ftp.trolltech.com/qt/source/qt-mac-free-3.3.7.tar.gz
—–

Comments

Running GNUMakefile

make generates the following error:

Compiling HxBSpline.cpp …
g++ -I/Users/erlebach/Documents/src/avizo_local/src -I/Users/erlebach/Documents/src/avizo_local/src/amiraKernel/mclib -I/Users/erlebach/Documents/src/avizo_local/include/arch-MacX/ -I/Users/erlebach/Documents/src/avizo_local/include/arch-MacX/qt -I/Users/erlebach/Documents/src/avizo_local/include/arch-MacX/oiv -I/Users/erlebach/Documents/src/avizo_local/include -I/Applications/Avizo500.app/Contents/MacOS/include -I/Applications/Avizo500.app/Contents/MacOS/include/mclib -I/Applications/Avizo500.app/Contents/MacOS/include/arch-MacX -I/Applications/Avizo500.app/Contents/MacOS/include/arch-MacX/qt -I/Applications/Avizo500.app/Contents/MacOS/include/arch-MacX/oiv -dynamiclib -fPIC -fno-common -DQT_THREAD_SUPPORT -DQT_CLEAN_NAMESPACE -DSOQT -DTGS_OIV -I/System/Library/Frameworks/Carbon.framework/Headers -I/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Headers/ -I/Users/erlebach/Documents/src/avizo_local/include/arch-MacX/globus -DQT_THREAD_SUPPORT -Wall -Wno-unknown-pragmas -pipe -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -D_REENTRANT -DHX_OS_MACX -DNEWSTYLE_IOSTREAM -DFORTRAN_UNDERLINE -DHX_NO_MATHF -DHX_HAS_STD -DHX_HAS_STDCOMPLEX -DHX_HAS_STDIOSTREAM -DHX_NO_X11 -include “mclib/McConfigMacX.h” -g -DPACKAGEID=amirapackage_mylines -c /Users/erlebach/Documents/src/avizo_local/src/mylines/HxBSpline.cpp -o HxBSpline.o
cc1plus: error: unrecognized command line option “-arch”
cc1plus: error: unrecognized command line option “-arch”

How can this be? I am using G++ 4.3.0 on my mac. There is -march=… . Same is true with g++ on lLinux with version 4.1.2 .

I changed, in /Applications/Avizo500.app/Contents/MacOS/make the file arch-MacX.cfg

#HX_ARCH_FLAGS=-arch i386 -arch ppc
# GErlebacher
#HX_ARCH_FLAGS=-march=i386 -march=ppc
HX_ARCH_FLAGS=-march=i386

I get the following errors (many of them) (include paths not found):
In file included from /Users/erlebach/Documents/src/avizo_local/src/mylines/HxBSpline.cpp:3:
/Users/erlebach/Documents/src/avizo_local/src/mylines/HxBSpline.h:4:21: error: HxCurve.h: No such file or directory

For some reason, the GNUMakefile does NOT include -I. , so I included it manually:

INCLUDES += \
-I.
-I$(AMIRA_LOCAL)/src

(THIS OBVIOUSLY WAS NOT TESTED BY Mercury).

The “-I.” did not work. However, -I/Users/erlebach/Documents/src/avizo_local/src/mylines \
did work (full path). WHY? Do not know.

Compiled ok: HxBSpline.cpp, HxComputeContours.cpp, HxCurve.cpp, HxCurveEditor.cpp, HxCurveToLineSetInterface.cpp, HxDisplayLineSet.cpp, HxLineSet.cpp,

Error in HxLineSetEditor.cpp . All related to not having the required qt include files, which do not seem to be Avizo-related. So I will work on this. Must use moc compiler, etc. for Mac.

/Users/erlebach/Documents/src/avizo_local/src/mylines/HxLineSetEditor.cpp:128:21: error: qdialog.h: No such file or directory
/Users/erlebach/Documents/src/avizo_local/src/mylines/HxLineSetEditor.cpp:129:23: error: qlineedit.h: No such file or directory
/Users/erlebach/Documents/src/avizo_local/src/mylines/HxLineSetEditor.cpp:130:26: error: qbuttongroup.h: No such file or directory
/Users/erlebach/Documents/src/avizo_local/src/mylines/HxLineSetEditor.cpp:131:25: error: qpushbutton.h: No such file or directory
/Users/erlebach/Documents/src/avizo_local/src/mylines/HxLineSetEditor.cpp:132:20: error: qlabel.h: No such file or directory
/Users/erlebach/Documents/src/avizo_local/src/mylines/HxLineSetEditor.cpp:133:21: error: qlayout.h: No such file or directory
/Users/erlebach/Documents/src/avizo_local/src/mylines/HxLineSetEditor.cpp:134:23: error: qcheckbox.h: No such file or directory

I added to include files in GNUMakefile:

-I/Library/Frameworks/QtCore.framework/Versions/4/Headers/ \
-I/Library/Frameworks/QtGui.framework/Versions/4/Headers/ \

Yet, still cannot find qscrollview.h . WHY NOT?

The proper way to use Qt on the mac is using frameworks, which this Makefile is not doing.

I got qscrollview.h from the internet (Qt 3.3.7) and put it in my home directory.
http://doc.trolltech.com/3.3/qscrollview-h.html

More errors:
from /Users/erlebach/Documents/src/avizo_local/src/mylines/HxLineSetEditor.cpp:146:
/usr/local/lib/gcc/i386-apple-darwin9.0.0/4.3.0/include/xmmintrin.h:35:3: error: #error “SSE instruction set not enabled” and many more. Of course, I have not used moc yet.

Why does Amira still use Qt 3.3.6 and not something more recent?

Comments

Initial Installation

I unpacked the modules sent by Shawn to my mac, under src/avizo_local. First, I notice that under mylines/, the Qt interfaces were designed with software running under Windows. I am looking to port the entire system to my mac. I wonder if the interfaces are immediately portable. Second, what directory do I unpack qt headers into (I have not found them yet).

Documentation seems to imply I need Qt3.3.6 . I have Qt4.4 on my mac. Will that be a problem?

Under avizo_local/src/mylines/, I do not find a Makefile. Perhaps it must be regenerated from the development wizard?

I would have expected under avizo_local/ a set of directories, one per project. Not so. Therefore, it is not obvious, in the Development wizard from Avizo, what it means to add a package. I just tried to create a package gordonxxx, and it created avizo_local/src/gordonxxx/ . I then add an ordinary module under gordonxxx (THAT SHOULD BE THE DEFAULT, and it is not!). Next, the class, MyLines, name in popup menu (mylines), attach to HxUniformScalarField3, define input class in gordonxxx (when would it be defined elsewhere?). Finally, create build system, target single package (gordonxxx), GNUMakefile was created under gordonxxx.

Conclusion, to get a GNUMakefile for mylineset, simply create the build system.

Comments