Skip to content

Commit

Permalink
Refs #4024 moving out Nexus CPP from mantid. Tests don't pass yet
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik Zikovsky committed Nov 4, 2011
1 parent aba9d7f commit e9f63ce
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Code/Mantid/Build/CMake/FindNexus.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

find_path ( NEXUS_INCLUDE_DIR napi.h )

find_library ( NEXUS_LIBRARIES NAMES NeXus libNeXus-0 )
find_library ( NEXUS_LIBRARIES NAMES NeXusCPP )

# handle the QUIETLY and REQUIRED arguments and set NEXUS_FOUND to TRUE if
# all listed variables are TRUE
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ add_subdirectory ( Framework )
include_directories ( Framework/Kernel/inc )
include_directories ( Framework/Geometry/inc )
include_directories ( Framework/API/inc )
set ( CORE_MANTIDLIBS Kernel Geometry API )
set ( CORE_MANTIDLIBS Kernel Geometry API NeXusCPP)

add_subdirectory ( MantidQt )

Expand Down
4 changes: 3 additions & 1 deletion Code/Mantid/Framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ set ( MANTIDLIBS ${Boost_LIBRARIES} ${POCO_LIBRARIES} ${TCMALLOC_LIBRARY} ${MPI
add_custom_target ( FrameworkTests ) # target for all framework tests
add_dependencies ( check FrameworkTests )

set ( MANTIDLIBS ${MANTIDLIBS} NeXusCPP )

include_directories (Kernel/inc)
add_subdirectory (Kernel)
set ( MANTIDLIBS ${MANTIDLIBS} Kernel )
Expand Down Expand Up @@ -151,7 +153,7 @@ add_subdirectory (MDEvents)

set ( FRAMEWORK_LIBS Kernel Geometry API PythonAPI PythonKernelModule PythonAPIModule DataObjects
DataHandling Nexus Algorithms CurveFitting ICat
Crystal MDAlgorithms MDEvents WorkflowAlgorithms NeXus
Crystal MDAlgorithms MDEvents WorkflowAlgorithms
)

add_custom_target( Framework DEPENDS ${FRAMEWORK_LIBS} )
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/SaveNXSPE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ namespace Mantid
nxFile.makeData("data", ::NeXus::FLOAT64, array_dims, false);
nxFile.makeData("error", ::NeXus::FLOAT64, array_dims, false);

std::vector<int> slab_start;
std::vector<int> slab_size;
std::vector<int64_t> slab_start;
std::vector<int64_t> slab_size;

// What size slabs are we going to write...
slab_size.push_back(1);
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/MDEvents/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ if ( CXXTEST_FOUND )
if ( GMOCK_FOUND AND GTEST_FOUND )
cxxtest_add_test ( MDEventsTest ${TEST_FILES} ${GMOCK_TEST_FILES} )
target_link_libraries( MDEventsTest MDEvents ${MANTIDLIBS}
${GMOCK_LIBRARIES} ${GTEST_LIBRARIES} DataHandling Nexus
${GMOCK_LIBRARIES} ${GTEST_LIBRARIES} DataHandling Nexus NeXusCPP
TestHelpers)
else ()
cxxtest_add_test ( MDEventsTest ${TEST_FILES} )
target_link_libraries( MDEventsTest MDEvents ${MANTIDLIBS}
DataHandling Nexus TestHelpers )
DataHandling Nexus TestHelpers NeXusCPP)
endif ()

add_dependencies ( FrameworkTests MDEventsTest )
Expand Down
11 changes: 5 additions & 6 deletions Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,8 @@ namespace MDEvents
size_t numEvents = events.size();
std::vector<double> data;
data.reserve(numEvents*(nd+4));
std::vector<int> start(2,0);
//TODO: WARNING NEXUS NEEDS TO BE UPDATED TO USE 64-bit ints on Windows.
start[0] = int(startIndex);
std::vector<int64_t> start(2,0);
start[0] = int64_t(startIndex);

totalSignal = 0;
totalErrorSquared = 0;
Expand All @@ -244,9 +243,9 @@ namespace MDEvents
}

// Specify the dimensions
std::vector<int> dims;
dims.push_back(int(numEvents));
dims.push_back(int(nd+4));
std::vector<int64_t> dims;
dims.push_back(int64_t(numEvents));
dims.push_back(int64_t(nd+4));

file->putSlab(data, start, dims);
}
Expand Down
11 changes: 5 additions & 6 deletions Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDLeanEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,8 @@ namespace MDEvents
size_t numEvents = events.size();
std::vector<double> data;
data.reserve(numEvents*(nd+2));
std::vector<int> start(2,0);
//TODO: WARNING NEXUS NEEDS TO BE UPDATED TO USE 64-bit ints on Windows.
start[0] = int(startIndex);
std::vector<int64_t> start(2,0);
start[0] = int64_t(startIndex);

totalSignal = 0;
totalErrorSquared = 0;
Expand All @@ -323,9 +322,9 @@ namespace MDEvents
}

// Specify the dimensions
std::vector<int> dims;
dims.push_back(int(numEvents));
dims.push_back(int(nd+2));
std::vector<int64_t> dims;
dims.push_back(int64_t(numEvents));
dims.push_back(int64_t(nd+2));

file->putSlab(data, start, dims);
}
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/Nexus/test/NexusAPITest.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ class NexusAPITest : public CxxTest::TestSuite

// 2d double data - slab test
file.makeData("r8_data", ::NeXus::FLOAT64, array_dims, true);
vector<int> slab_start;
vector<int64_t> slab_start;
slab_start.push_back(4);
slab_start.push_back(0);
vector<int> slab_size;
vector<int64_t> slab_size;
slab_size.push_back(1);
slab_size.push_back(4);
file.putSlab(&(r8_array[16]), slab_start, slab_size);
Expand Down
1 change: 1 addition & 0 deletions Code/Mantid/Vates/VatesAPI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ ${MANTID_SUBPROJECT_LIBS}
vtkCommon
vtkFiltering
Crystal
NeXusCPP
)

# Create test file projects
Expand Down

0 comments on commit e9f63ce

Please sign in to comment.