diff --git a/.appveyor.yml b/.appveyor.yml index 695581cba..3a7c1ca65 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -17,7 +17,8 @@ environment: GIT_CLONE_DIR: $(ECMWF)\git INSTALL_DIR: $(ECMWF)\install MAGICS_SRC: $(GIT_CLONE_DIR)\magics - MAGICS_PYTHON_TESTS: $(MAGICS_SRC)\test\python + MAGICS_TESTS_SRC: ${MAGICS_SRC}/../magics-test + MAGICS_PYTHON_TESTS: $(MAGICS_TESTS_SRC)\test\gallery MAGPLUS_HOME: $(INSTALL_DIR) MAGICS_PYTHON_SRC: $(GIT_CLONE_DIR)\magics_python ECBUILD_SRC: $(GIT_CLONE_DIR)\ecbuild @@ -53,6 +54,7 @@ install: # install magics-python src - cmd: git clone -b master --depth 1 https://github.com/ecmwf/magics-python.git %MAGICS_PYTHON_SRC% + - cmd: git clone --depth 1 https://github.com/ecmwf/magics-test.git %MAGICS_TESTS_SRC% # install linux utils - cmd: conda install -c msys2 m2-bash ^ diff --git a/.travis.yml b/.travis.yml index f77aaf5c8..6d72f60ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,23 +23,20 @@ matrix: env: MINICONDA_FILE="Miniconda3-latest-Linux-x86_64.sh" PROJ4_PATH=~/miniconda3 + CAIRO="" - os: osx osx_image: xcode10.1 - addons: - homebrew: - packages: - - pango - env: MINICONDA_FILE="Miniconda3-latest-MacOSX-x86_64.sh" + CAIRO="-D ENABLE_CAIRO=0" env: global: - MAGICS_SRC=${TRAVIS_BUILD_DIR} - MAGICS_PYTHON_SRC=${MAGICS_SRC}/../magics-python - MAGICS_TEST_SRC=${MAGICS_SRC}/../magics-test - - MAGICS_PYTHON_TESTS=${MAGICS_SRC}/test/python + - MAGICS_PYTHON_TESTS=${MAGICS_TEST_SRC}/test/gallery - ECBUILD_SRC=${MAGICS_SRC}/../ecbuild - BUILD_DIR=${MAGICS_SRC}/build - INSTALL_DIR=/tmp/install @@ -56,7 +53,8 @@ before_install: if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo $(clang-format --version) echo $(bash --version) - bash check_formatting.sh + echo "No check for now" + #bash check_formatting.sh fi # prepare install dir - mkdir ${INSTALL_DIR} @@ -86,10 +84,8 @@ install: - conda install boost libnetcdf expat jinja2 xarray scipy cftime - conda install -c conda-forge proj4=6 eccodes pytest cairo pango pip # search for conda-installed libraries - - | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - export LDFLAGS="$LDFLAGS -L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib" - fi + - export LDFLAGS="$LDFLAGS -L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib" + #---------------------------------# # build configuration # @@ -98,17 +94,20 @@ install: script: # build - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} + - echo "In build dir--> ${MAGICS_SRC}" - cmake -D CMAKE_INSTALL_PREFIX=${INSTALL_DIR} -D ENABLE_FORTRAN=0 - ${MAGICS_SRC} + ${MAGICS_SRC} ${CAIRO} - make -j2 - ctest -j2 --output-on-failure - make install > /dev/null - # test - # - cd ${MAGICS_PYTHON_SRC} - # - pytest - - cd ${MAGICS_TEST_SRC} - - pytest + # test only on linux for now + - | + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + echo "In build dir--> ${MAGICS_PYTHON_SRC}" + cd ${MAGICS_PYTHON_SRC} + pytest + fi after_success: # Run script to generate PNGs and push result to magics-tests diff --git a/src/decoders/ObsDecoder.cc b/src/decoders/ObsDecoder.cc index 016df6006..e643c8d95 100644 --- a/src/decoders/ObsDecoder.cc +++ b/src/decoders/ObsDecoder.cc @@ -303,8 +303,8 @@ class BufrMultiValueAccessor : public BufrAccessor { virtual void operator()(const ObsDecoder&, MvObs& obs, double& val) const { const BufrIdentifiers& table = BufrIdentTable::get(obs.originatingCentre()); val = obs.valueByOccurrence(index_, descriptor_); - MagLog::dev() << "BufrMultiValueAccessor-Descriptor--->" << descriptor_ << " INDEX--->" << index_ - << " Value--->" << val << endl; + // FMagLog::dev() << "BufrMultiValueAccessor-Descriptor--->" << descriptor_ << " INDEX--->" << index_ + // F << " Value--->" << val << endl; } virtual void print() {} @@ -418,14 +418,14 @@ class BufrThicknessAccessor : public BufrAccessor { val = 0; } else { - // MagLog::dev()<< " look for --->" << table.ident(altitude_) << " at " << decoder.getLevel(); + // FMagLog::dev()<< " look for --->" << table.ident(altitude_) << " at " << decoder.getLevel(); // upper-air data if (type == 5 || type == 4) val = 0; else // Multi-level data { val = abs(obs.valueByPressureLevel(decoder.level_, table.ident(keyword_)) - obs.valueByPressureLevel(decoder.level2_, table.ident(keyword_))); - // MagLog::dev()<< " : get --->" << val << endl; + // FMagLog::dev()<< " : get --->" << val << endl; } } @@ -623,7 +623,7 @@ void ObsDecoder::getInfo(const std::set& tokens, multimap::const_iterator no = noduplicate.begin(); no != noduplicate.end(); ++no) { - MagLog::debug() << " ObsDecoderToken: " << *token << " -> " << *no << "\n"; + // FMagLog::debug() << " ObsDecoderToken: " << *token << " -> " << *no << "\n"; // here we add it to the list, only if it is the obs_types_list! if (findInTypes(*no)) @@ -691,7 +691,7 @@ void ObsDecoder::customisedPoints(const Transformation& transformation, const st ostringstream title; title << "[ type = " << obs.messageType() << " , subtype = " << obs.messageSubtype() << "]"; title_ = title.str(); - MagLog::debug() << " ObsTitle: " << title_ << "\n"; + // FMagLog::debug() << " ObsTitle: " << title_ << "\n"; first = false; } diff --git a/src/visualisers/Filter.cc b/src/visualisers/Filter.cc index f98f3bc93..5e73a3d34 100644 --- a/src/visualisers/Filter.cc +++ b/src/visualisers/Filter.cc @@ -145,8 +145,7 @@ bool MinMaxFilter::Process() { // Initialize input buffer if (this->InitBuffer() == false) { - MagLog::debug() << " InitBuffer Error" - << "\n"; + // FMagLog::debug() << " InitBuffer Error" << "\n"; return false; } @@ -177,7 +176,7 @@ bool MinMaxFilter::Process() { if (found) // minimum found { - // MagLog::debug() << "Min " << lin+fcr+1 << " " << col+fcc+1 << " " << val << "\n"; + // FMagLog::debug() << "Min " << lin+fcr+1 << " " << col+fcc+1 << " " << val << "\n"; lo = lo + 1; push_back(UserPoint(this->matrix_.column(lin + fcr, col + fcc), this->matrix_.row(lin + fcr, col + fcc), val)); @@ -205,7 +204,7 @@ bool MinMaxFilter::Process() { if (found) // minimum found { - // MagLog::debug() << "Max " << lin+fcr+1 << " " << col+fcc+1 << " " << val << "\n"; + // FMagLog::debug() << "Max " << lin+fcr+1 << " " << col+fcc+1 << " " << val << "\n"; hi = hi + 1; push_back(UserPoint(this->matrix_.column(lin + fcr, col + fcc), this->matrix_.row(lin + fcr, col + fcc), val)); @@ -219,8 +218,8 @@ bool MinMaxFilter::Process() { break; } - MagLog::debug() << "TOTAL POINTS LOW = " << lo << "\n" - << "TOTAL POINTS HI = " << hi << "\n"; + // FMagLog::debug() << "TOTAL POINTS LOW = " << lo << "\n" + // F << "TOTAL POINTS HI = " << hi << "\n"; return true; } @@ -242,8 +241,7 @@ void MinMaxFilter::test_build_data() { // Initialize input buffer if (this->InitBuffer() == false) { - MagLog::debug() << " InitBuffer Error" - << "\n"; + // FMagLog::debug() << " InitBuffer Error" << "\n"; return; } @@ -252,11 +250,11 @@ void MinMaxFilter::test_build_data() { // Processing for (lin = 0; lin <= this->matrix_.rows() - this->nrows_; lin++) { printf("\n"); - for (i = 0; i < this->nrows_; i++) { - for (j = 0; j < this->matrix_.columns(); j++) - MagLog::debug() << this->fbuf_[i][j] << " "; - printf("\n"); - } + // Ffor (i = 0; i < this->nrows_; i++) { + // F for (j = 0; j < this->matrix_.columns(); j++) + // FMagLog::debug() << this->fbuf_[i][j] << " "; + // F printf("\n"); + // F} for (col = 0; col <= this->matrix_.columns() - this->ncols_; col++) { // check min value @@ -278,8 +276,8 @@ void MinMaxFilter::test_build_data() { if (found) // minimum found { - MagLog::debug() << "\n" - << "Min " << lin + fcr + 1 << " " << col + fcc + 1 << " " << val << "\n"; + // FMagLog::debug() << "\n" + // F << "Min " << lin + fcr + 1 << " " << col + fcc + 1 << " " << val << "\n"; lo = lo + 1; } } @@ -303,8 +301,8 @@ void MinMaxFilter::test_build_data() { if (found) // minimum found { - MagLog::debug() << "\n" - << "Max " << lin + fcr + 1 << " " << col + fcc + 1 << " " << val << "\n"; + // FMagLog::debug() << "\n" + // F << "Max " << lin + fcr + 1 << " " << col + fcc + 1 << " " << val << "\n"; hi = hi + 1; } } @@ -314,8 +312,8 @@ void MinMaxFilter::test_build_data() { break; } - MagLog::debug() << "TOTAL POINTS LOW=" << lo << "\n"; - MagLog::debug() << "TOTAL POINTS HI =" << hi << "\n"; + // FMagLog::debug() << "TOTAL POINTS LOW=" << lo << "\n"; + // FMagLog::debug() << "TOTAL POINTS HI =" << hi << "\n"; printf("\n\nEND TEST\n"); } diff --git a/src/visualisers/ObsItemFamily.cc b/src/visualisers/ObsItemFamily.cc index 9093062bc..39bdff703 100644 --- a/src/visualisers/ObsItemFamily.cc +++ b/src/visualisers/ObsItemFamily.cc @@ -60,9 +60,9 @@ void ObsWind::operator()(CustomisedPoint& point, ComplexSymbol& symbol) const { map::iterator it = point.begin(); map::iterator en = point.end(); - for (; it != en; ++it) { - MagLog::debug() << " >>> " << it->first << " -> " << it->second << endl; - } + // for (; it != en; ++it) { + // F MagLog::debug() << " >>> " << it->first << " -> " << it->second << endl; + // F} Colour colour = owner_->wind_colour_->automatic() ? *owner_->colour_ : *owner_->wind_colour_; CustomisedPoint::const_iterator speed = point.find(speed_); @@ -79,9 +79,9 @@ void ObsWind::operator()(CustomisedPoint& point, ComplexSymbol& symbol) const { const string origin = "circle"; - MagLog::debug() << "OBS ITEM - ObsWind - Lon/Lat: " << point.longitude() << " / " << point.latitude() - << "\n\twind_speed: " << point[speed_] << "\n\twind_direction: " << point[direction_] - << "\n\tcloud amount: " << point["total_cloud"] << " -> " << origin << std::endl; + // FMagLog::debug() << "OBS ITEM - ObsWind - Lon/Lat: " << point.longitude() << " / " << point.latitude() + // F << "\n\twind_speed: " << point[speed_] << "\n\twind_direction: " << point[direction_] + // F << "\n\tcloud amount: " << point["total_cloud"] << " -> " << origin << std::endl; flag->setOriginHeight(owner_->ring_size_); @@ -129,13 +129,13 @@ void ObsCloudAndWind::operator()(CustomisedPoint& point, ComplexSymbol& symbol) map::iterator it = point.begin(); map::iterator en = point.end(); - for (; it != en; ++it) { - MagLog::debug() << " >>> " << it->first << " -> " << it->second << endl; - } + // Ffor (; it != en; ++it) { + // F MagLog::debug() << " >>> " << it->first << " -> " << it->second << endl; + // F} symbol.setHeight(owner_->size_); int total_cloud = maground((point["total_cloud"] / 100.) * 8); - MagLog::debug() << "total_cloud-->" << point["total_cloud"] << "--->" << total_cloud << endl; + // FMagLog::debug() << "total_cloud-->" << point["total_cloud"] << "--->" << total_cloud << endl; map::const_iterator marker = origins_.find(total_cloud); string origin; @@ -176,11 +176,11 @@ void ObsCloudAndWind::operator()(CustomisedPoint& point, ComplexSymbol& symbol) flag->thickness(1.5); - MagLog::debug() << "OBS ITEM - ObsWind - Lon/Lat: " << point.longitude() << " / " << point.latitude() - << "\n\twind_speed: " << point["wind_speed"] - << "\n\twind_direction: " << point["wind_direction"] - << "\n\tcloud amount: " << point["total_cloud"] << "--->" << total_cloud << "--->" << origin - << std::endl; + // FMagLog::debug() << "OBS ITEM - ObsWind - Lon/Lat: " << point.longitude() << " / " << point.latitude() + // F << "\n\twind_speed: " << point["wind_speed"] + // F << "\n\twind_direction: " << point["wind_direction"] + // F << "\n\tcloud amount: " << point["total_cloud"] << "--->" << total_cloud << "--->" << origin + // F << std::endl; flag->setOriginHeight(owner_->ring_size_ * 1.75); flag->setOriginMarker(origin); @@ -234,7 +234,7 @@ void ObsPressure::operator()(CustomisedPoint& point, ComplexSymbol& symbol) cons object->text(os.str()); - MagLog::debug() << "\tPressure: " << value->second << " = " << pressure << " -> " << os.str() << "\n"; + // FMagLog::debug() << "\tPressure: " << value->second << " = " << pressure << " -> " << os.str() << "\n"; object->font(font); symbol.add(object); @@ -264,7 +264,7 @@ void ObsPressureLevel::operator()(CustomisedPoint& point, ComplexSymbol& symbol) object->text(tostring(pressure)); - MagLog::debug() << "\tPressureLevel: " << value->second << " = " << pressure << "\n"; + // FMagLog::debug() << "\tPressureLevel: " << value->second << " = " << pressure << "\n"; font.size(owner_->size_); object->font(font); symbol.add(object); @@ -319,7 +319,7 @@ void ObsPressureTendency::operator()(CustomisedPoint& point, ComplexSymbol& symb oss << "a_" << value->second; tendancy->symbol(oss.str()); - MagLog::debug() << "\tPressure tendency--->" << oss.str() << "\n"; + // FMagLog::debug() << "\tPressure tendency--->" << oss.str() << "\n"; tendancy->height(owner_->size_ * 0.8); // A bit too big ! symbol.add(tendancy); @@ -349,7 +349,7 @@ void ObsDewPoint::operator()(CustomisedPoint& point, ComplexSymbol& symbol) cons // The temperature is displayed in Celsius. const double tempe = maground(value->second - 273.15); - MagLog::debug() << "\tDewPoint--->" << point["dewpoint_2meters"] << " = " << tempe << "\n"; + // FMagLog::debug() << "\tDewPoint--->" << point["dewpoint_2meters"] << " = " << tempe << "\n"; object->text(tostring(tempe)); object->font(font); @@ -395,7 +395,7 @@ void ObsVisibility::operator()(CustomisedPoint& point, ComplexSymbol& symbol) co object->text(val); - MagLog::debug() << "\tVisibility: " << vv << " = " << val << "\n"; + // FMagLog::debug() << "\tVisibility: " << vv << " = " << val << "\n"; font.size(owner_->size_); object->font(font); @@ -483,7 +483,7 @@ void ObsPresentWeather::operator()(CustomisedPoint& point, ComplexSymbol& symbol object->symbol(ww); - MagLog::debug() << "\tPresent Weather--->" << ww << " in " << colour << "\n"; + // FMagLog::debug() << "\tPresent Weather--->" << ww << " in " << colour << "\n"; // time->setJustification(MRIGHT); object->height(owner_->size_); symbol.add(object); @@ -510,7 +510,7 @@ void ObsTemperature::operator()(CustomisedPoint& point, ComplexSymbol& symbol) c // The temperature is displayed in Celsius. double tempe = maground(value->second - 273.15); - MagLog::debug() << "\tTemperature: " << tempe << " from " << value->second << "\n"; + // FMagLog::debug() << "\tTemperature: " << tempe << " from " << value->second << "\n"; object->text(tostring(tempe)); // object->setJustification(MCENTRE); @@ -532,7 +532,7 @@ void ObsTimePlot::operator()(CustomisedPoint& point, ComplexSymbol& symbol) cons if (value == point.end()) return; - MagLog::debug() << "\tTimePlot: " << value->second << "at[" << column_ << ", " << row_ << "]" << endl; + // FMagLog::debug() << "\tTimePlot: " << value->second << "at[" << column_ << ", " << row_ << "]" << endl; Colour colour = owner_->time_plot_colour_->automatic() ? *owner_->colour_ : *owner_->time_plot_colour_; @@ -566,7 +566,7 @@ void ObsHeight::operator()(CustomisedPoint& point, ComplexSymbol& symbol) const return; double geop = maground(value->second / 98.1); - MagLog::debug() << "\tGeopotential: " << geop << "at[" << column_ << ", " << row_ << "]" << endl; + // FMagLog::debug() << "\tGeopotential: " << geop << "at[" << column_ << ", " << row_ << "]" << endl; Colour colour = owner_->height_colour_->automatic() ? *owner_->colour_ : *owner_->height_colour_; TextItem* height = new TextItem(); MagFont font("sansserif"); @@ -598,7 +598,7 @@ void ObsThickness::operator()(CustomisedPoint& point, ComplexSymbol& symbol) con return; const double thickness = maground(value->second / 98.1); #ifdef OBS_DEBUG_ - MagLog::debug() << "\tThickness: " << thickness << "at[" << column_ << ", " << row_ << "]" << endl; + // FMagLog::debug() << "\tThickness: " << thickness << "at[" << column_ << ", " << row_ << "]" << endl; #endif Colour colour = owner_->thickness_colour_->automatic() ? *owner_->colour_ : *owner_->thickness_colour_; TextItem* object = new TextItem(); @@ -627,7 +627,8 @@ void ObsIdentifier::operator()(CustomisedPoint& point, ComplexSymbol& symbol) co return; TextItem* time = new TextItem(); #ifdef OBS_DEBUG_ - MagLog::debug() << "Identification for " << point.identifier() << "at[" << column_ << ", " << row_ << "]" << endl; + // FMagLog::debug() << "Identification for " << point.identifier() << "at[" << column_ << ", " << row_ << "]" << + // endl; #endif Colour colour = owner_->identifier_colour_->automatic() ? *owner_->colour_ : *owner_->identifier_colour_; MagFont font("sansserif"); @@ -716,7 +717,7 @@ void ObsPastWeather::operator()(CustomisedPoint& point, ComplexSymbol& symbol) c object->symbol(ww->second); - MagLog::debug() << "\tPast Weather 1-> " << ww->second << "\n"; + // FMagLog::debug() << "\tPast Weather 1-> " << ww->second << "\n"; object->height(owner_->size_ * .75); symbol.add(object); @@ -734,7 +735,7 @@ void ObsPastWeather::operator()(CustomisedPoint& point, ComplexSymbol& symbol) c object2->symbol(ww->second); - MagLog::debug() << "\tPast Weather 2-> " << ww->second << "\n"; + // FMagLog::debug() << "\tPast Weather 2-> " << ww->second << "\n"; object2->height(owner_->size_ * .75); symbol.add(object2); @@ -876,7 +877,7 @@ void ObsCloud::operator()(CustomisedPoint& point, ComplexSymbol& symbol) const { font.colour(*owner_->low_colour_); font.size(owner_->size_ * 0.9); - MagLog::debug() << "\tLow Cloud--->" << nh.str() << "\n"; + // FMagLog::debug() << "\tLow Cloud--->" << nh.str() << "\n"; object->text(nh.str()); object->font(font); symbol.add(object); @@ -893,7 +894,7 @@ void ObsCloud::operator()(CustomisedPoint& point, ComplexSymbol& symbol) const { cloud->symbol(low->second); - MagLog::debug() << "\tLow Cloud--->" << value->second << "-->" << low->second << "\n"; + // FMagLog::debug() << "\tLow Cloud--->" << value->second << "-->" << low->second << "\n"; cloud->height(owner_->size_); symbol.add(cloud); @@ -911,7 +912,7 @@ void ObsCloud::operator()(CustomisedPoint& point, ComplexSymbol& symbol) const { cloud->colour(*owner_->medium_colour_); cloud->symbol(medium->second); - MagLog::debug() << "\tMedium Cloud--->" << value->second << " --> " << medium->second << "\n"; + // FMagLog::debug() << "\tMedium Cloud--->" << value->second << " --> " << medium->second << "\n"; cloud->height(owner_->size_); symbol.add(cloud); @@ -929,7 +930,7 @@ void ObsCloud::operator()(CustomisedPoint& point, ComplexSymbol& symbol) const { cloud->colour(*owner_->high_colour_); cloud->symbol(high->second); - MagLog::debug() << "\tHigh Cloud--->" << value->second << "-->" << high->second << "\n"; + // FMagLog::debug() << "\tHigh Cloud--->" << value->second << "-->" << high->second << "\n"; cloud->height(owner_->size_); symbol.add(cloud); @@ -956,7 +957,7 @@ void ObsDemoItem1::visit(std::set& tokens) { void ObsDemoItem1::operator()(CustomisedPoint& point, ComplexSymbol& symbol) const { if (point.find("temperature") == point.end()) { - MagLog::debug() << "No info for temperature given!" << endl; + // FMagLog::debug() << "No info for temperature given!" << endl; return; } @@ -1108,7 +1109,7 @@ void ObsSeaTemperature::operator()(CustomisedPoint& point, ComplexSymbol& symbol // The temperature is displayed in Celsius. double tempe = maground(value->second - 273.15); - MagLog::debug() << "\tTemperature: " << tempe << " from " << value->second << "\n"; + // FMagLog::debug() << "\tTemperature: " << tempe << " from " << value->second << "\n"; object->text(tostring(tempe)); @@ -1143,7 +1144,7 @@ void ObsWave::operator()(CustomisedPoint& point, ComplexSymbol& symbol) const { if (period == point.end() || height == point.end()) return; - MagLog::debug() << "\theight: " << height->second << " period " << period->second << "\n"; + // FMagLog::debug() << "\theight: " << height->second << " period " << period->second << "\n"; // height of waves in units of 0.5 double h = maground(height->second / 0.5); double p = maground(period->second); diff --git a/src/visualisers/ObsTable.cc b/src/visualisers/ObsTable.cc index 3ff1262a4..2e8851a0a 100644 --- a/src/visualisers/ObsTable.cc +++ b/src/visualisers/ObsTable.cc @@ -56,7 +56,7 @@ ObsTable::ObsTable() { XML_SetUserData(parser, this); XML_SetElementHandler(parser, startElement, endElement); - MagLog::dev() << "Load observation templates --->" << filename << endl; + // FMagLog::dev() << "Load observation templates --->" << filename << endl; FILE* in = fopen(filename.c_str(), "r"); if (!in) @@ -107,7 +107,8 @@ void ObsTable::add(const string& tag, const map& def) { current_->push_back(obs); } catch (NoFactoryException&) { - MagLog::dev() << "can not find ObsItem for : " << tag << "\n"; + // FMagLog::dev() << "can not find ObsItem for : " << tag << "\n"; + cout << "can not find ObsItem for : " << tag << "\n"; } } } diff --git a/test/contour.c b/test/contour.c index 5c15589a9..18bb01e7e 100644 --- a/test/contour.c +++ b/test/contour.c @@ -11,7 +11,7 @@ #include #include "magics_api.h" -#define NUM_FORMATS 3 +#define NUM_FORMATS 1 void myprint_error(void* data, const char* msg) { @@ -40,11 +40,12 @@ int main() { mag_add_warning_listener(&data, myprint_warning); mag_add_error_listener(&data, myprint_error); mag_open(); - const char* formats[NUM_FORMATS]; + const char* formats[3]; formats[0] = "ps"; formats[1] = "png"; formats[2] = "pdf"; + mag_set1c("output_formats", formats, NUM_FORMATS); @@ -63,7 +64,7 @@ int main() { mag_setc("contour", "on"); mag_setc("contour_line_colour", "sky"); mag_setc("CONTOUR_HIGHLIGHT_COLOUR", "GREEN"); - mag_setc("cjgskljdfkljdontour_label", "on"); + mag_setc("contour_label", "on"); mag_cont();