Fix Latex typesetting
AbandonedPublic

Authored by asemke on Apr 5 2018, 5:29 PM.

Details

Reviewers
aacid
apol
sirgienko
filipesaraiva
Group Reviewers
Cantor
Summary

I need to do this change on openSUSE Leap 42.3 with cmake 3.5.2 and extra-cmake-modules 5.44 in order to set WITH_EPS correctly. Without this no latex typesetting is possible in Cantor even though libspectre is available on the system.

@aacid @apol this part in Cantor's CMakeLists.txt is from 2014. Somewhere last year I lost latex typesetting on openSUSE, most probably because of this parameter. Are you aware of any recent changes in FindLibSpectre.cmake when LibSpectre_FOUND was changed to LIBSPECTRE_FOUND? Or is there any other explanation for this problem?

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
asemke created this revision.Apr 5 2018, 5:29 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptApr 5 2018, 5:29 PM
Restricted Application added a subscriber: KDE Edu. · View Herald Transcript
asemke requested review of this revision.Apr 5 2018, 5:29 PM
asemke added a reviewer: filipesaraiva.

It's also fix bug with missing plots, when used eps files, in octave backend (files eps are exist, but don't show in cantor). This bug observed at least from 15.12 to nowdays (i just always have been forgoting to report about this bug).

aacid added a comment.Apr 5 2018, 8:26 PM

hmmm, this is weird, i don't really need this, the current code works for me

MESSAGE("LibSpectre_FOUND: ${LibSpectre_FOUND}")

just after the find_package says
LibSpectre_FOUND: TRUE
here when running on a clean build dir.

But it is true that ${LIBSPECTRE_FOUND} also prints true.

About the add_definitions you should not need it, the generated
src/lib/config-cantorlib.h
already has that define, just make sure you include that file wherever you need it.

Maybe my cmake is newer? I'm on cmake 3.10.3

sirgienko added a comment.EditedApr 5 2018, 9:10 PM

About the add_definitions you should not need it, the generated
src/lib/config-cantorlib.h
already has that define, just make sure you include that file wherever you need it.

Interesting, because add_definitions(-DWITH_EPS) make difference for me (cmake 3.5.1): without this line plots don't appear in cantor (and with this option they do). However LibSpectre_FOUND and LIBSPECTRE_FOUND don't make any difference for me too.

aacid added a comment.Apr 5 2018, 9:44 PM

About the add_definitions you should not need it, the generated
src/lib/config-cantorlib.h
already has that define, just make sure you include that file wherever you need it.

Interesting, because add_definitions(-DWITH_EPS) make difference for me (cmake 3.5.1): without this line plots don't appear in cantor (and with this option they do). However LibSpectre_FOUND and LIBSPECTRE_FOUND don't make any difference for me too.

This is probably because there is a fine that uses #if WITH_EPS or #ifdef WITH_EPS and does not include config-cantorlib.h

asemke added a comment.Apr 6 2018, 7:33 AM

hmmm, this is weird, i don't really need this, the current code works for me

MESSAGE("LibSpectre_FOUND: ${LibSpectre_FOUND}")

just after the find_package says
LibSpectre_FOUND: TRUE
here when running on a clean build dir.

But it is true that ${LIBSPECTRE_FOUND} also prints true.

This is really strange. I don't see nowhere in cantor/cmake/FindLibSpectre.cmake (not sure this file is really used by cmake) the variable LibSpectre_FOUND. Since cmake's variables are case sensitive I'd assume LIBSPECTRE_FOUND is the only correct one. Your cmake is newer than the version that I'm using. But this worked in cantor already in the past for sure, also with older versions of cmake...

About the add_definitions you should not need it, the generated
src/lib/config-cantorlib.h
already has that define, just make sure you include that file wherever you need it.

I don't see any includes for config-cantrolib.h in the code. Maybe this is added somewhere on the cmake-level. Some parts of the current code are aware of the definition of WITH_EPS, e.g. Expression::setResult(). Some other parts like Worksheet:: loginToSession() don't "see" this variable and require now either that include you mentioned or a preprocessor definition. Since #ifdef WITH_EPS is used in several different places in Cantor's code it will take some time now to test all those places. Given the current timeline/deadline for 18.04 I'd rather go with a preprocessor definition via add_defitions() - this is safer now and also more clean and clear, at least to me, since it's straight -forward to see where it's defined.

asemke added a comment.Apr 6 2018, 7:47 AM

About the add_definitions you should not need it, the generated
src/lib/config-cantorlib.h
already has that define, just make sure you include that file wherever you need it.

I don't see any includes for config-cantrolib.h in the code. Maybe this is added somewhere on the cmake-level. Some parts of the current code are aware of the definition of WITH_EPS, e.g. Expression::setResult(). Some other parts like Worksheet:: loginToSession() don't "see" this variable and require now either that include you mentioned or a preprocessor definition. Since #ifdef WITH_EPS is used in several different places in Cantor's code it will take some time now to test all those places. Given the current timeline/deadline for 18.04 I'd rather go with a preprocessor definition via add_defitions() - this is safer now and also more clean and clear, at least to me, since it's straight -forward to see where it's defined.

Correction: I was looking for wrong file name. config-cantorlib.h is included at several places. Looks like we simply miss #include <config-cantorlib.h> in wokrsheet.cpp. @sirgienko can you add this include and to try out your test scenarios for octave? It should work also without that add_definiton() line in CMakeLists.

asemke updated this revision to Diff 31464.Apr 6 2018, 8:05 AM
sirgienko added a comment.EditedApr 6 2018, 12:15 PM

Correction: I was looking for wrong file name. config-cantorlib.h is included at several places. Looks like we simply miss #include <config-cantorlib.h> in wokrsheet.cpp. @sirgienko can you add this include and to try out your test scenarios for octave? It should work also without that add_definiton() line in CMakeLists.

Well, It's don't work for me. Plots don't show. But maxima backend starts produce LaTeX output, that's great.

Yes, it works, the plots are displayed.

@asemke, Could you please add aacid changes to your diff?

asemke updated this revision to Diff 31511.Apr 6 2018, 6:05 PM
asemke added a comment.Apr 6 2018, 6:07 PM

@asemke, Could you please add aacid changes to your diff?

Done.