Author Topic: Experiments With ConceptGCC  (Read 847 times)

0 Members and 1 Guest are viewing this topic.

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4765
  • Life teaches me not to want it.
    • What Now?
Experiments With ConceptGCC
« on: November 11, 2015, 12:00:40 am »
NOTICE: This post is 4 years old, and I am leaving a link at the end of this original post to a "living document" (2019 Autumn)
_______________________________________________________________

NOTE TO SELF:  Maybe I can apply this procedure when trying to get ConceptGCC to compile so I can try compiling the experimental code at asutton.github.io/origin/start.html

git clone git@github.com:/origin.git

HINTS:  kevinchen.co/blog/how-to-get-started-cpp-concepts

________________________________________________________________________
mkdir ~/concept_install

cd ~/concept_install

svn checkout svn://gcc.gnu.org/svn/gcc/branches/c++-concepts  conceptgcc

This will create directory ~/concept_install/conceptgcc

mkdir ~/concept_install/conceptgcc_build

(From inside ~/concept_install, mkdir conceptgcc_build)

This will be the "scratch" directory.


sudo mkdir -p /opt/concept

        This will create the directory which will hold the experimental Concept-C++ conceptgcc compiler

cd conceptgcc_build  (it's in ~/concept_install)

From here we will configure, and the configure executable file is in ~/concept_install/conceptgcc.  So, from the scratch directory (~/concept_install/conceptgcc_build):

../conceptgcc/configure  --prefix=/opt/concept --with-gmp=/opt/gmp-6.1.0 --with-mpfr=/opt/mpfr-3.1.3 --with-mpc=/opt/mpc-1.0.3 --disable-multilib --enable-languages=c,c++  --enable-shared --with-tune=generic --disable-checking --enable-multiarch --enable-threads=posix --without-included-gettext


make -j 4

sudo make install


ls /opt/concepts

there should now be executables (bin) and libraries (lib) (in /opt/concept) if all went well.

NOTE TO SELF:  Attempting this with the experimental branches, using the freshly created "prerequisites" in /opt ... start after well rested.  There is no rush to get the experimental compiler compiled.

Check out GCC 5.2 and the command-line option -std=c++11

~ for madmen only ~   :-\
_______________________________________________________________
(2019:  -std=c++17 ? -std=c++20 ?) ::::======>  Templates and generic programming


« Last Edit: September 21, 2019, 02:31:42 pm by Haywire Baboonery »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Share on Facebook Share on Twitter


Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4765
  • Life teaches me not to want it.
    • What Now?
Even with all that, I still get the same error while "make -j 4"

*** THIS BRANCH IS NO LONGER UNDER DEVELOPMENT ***
*** CONCEPTS HAS BEEN MERGED INTO TRUNK ***

 :'(

Oh well.  I gave it the old college try.

I will do some more research, but I will not be obsessed.

I've got gcc-5.2.0 and the command line option -std=c++11

I just don't have the experimental concept compiler with the command line option -std=c++1z

 ???

I'm not in the inner circle.  I'll have to wait until 2017 when it might be in the standard release.

Until then, I'm behind the 8-ball and have plenty to learn just tinkering with the Standard Library.

By the time I have a better understanding of concepts, algorithms, containers (data structures), and iterators (pointers), maybe the uber-smart "egg heads" might have this concept-C++ wrapped up tight (in the gcc x.x.x release) for chimpanzees firing on less than 8 cylinders (like me) to monkey around with.   :P

research: 

I am fairly certain that the source code for this experimental compiler is at generic-programming.org

svn co https://svn.osl.iu.edu/svn/hlo/releases/conceptgcc-4.3.0-alpha-6

I don't have a username or a password.  It's Indiana University.

I am reading this paper from there:  Implementing Concepts.

I guess one has to be on a damn committee or something to download ConceptGCC or even the G compiler.

Motivations for Concept-Based Optimizations

Concept-Based Optimization paper 

 Xiaolong Tang the author of the above paper.... He's got a link to a conceptgcc-axiom compiler on his home page!!!  ;D :D

YES!

It's 2AM, do you know where your head is at?

Download conceptgcc-axiom.tar.bz2


It unpacks pre-compiled???  Well, that's no fun.  What's going on?  It's not conceptgcc ...  >:(

Hmm...

Quote
The prototype is built on Douglas Gregor's ConceptGCC (Douglas Gregor is from the Open Systems Laboratory in Indiana University) which implements the generic programming features in the forthcoming revision of C++, known as C++0X. The compiler ConceptGCC, built on GCC, implements a preliminary version of the concepts feature in C++0X. A detailed description on ConceptGCC can be found via this link: ConceptGCC. The remainder of this webpage describes how to check out the source code of this prototype, build the source code, install the just built compiler, and experience concept-based optimizations with it.

Quote
Using Our Prototype for Concept-Based Optimizations

We already built a prototype that supports concept-based optimizations and the following describes how to use this prototype in detail. The prototype is built on Douglas Gregor's ConceptGCC (Douglas Gregor is from the Open Systems Laboratory in Indiana University) which implements the generic programming features in the forthcoming revision of C++, known as C++0X. The compiler ConceptGCC, built on GCC, implements a preliminary version of the concepts feature in C++0X. A detailed description on ConceptGCC can be found via this link: ConceptGCC. The remainder of this webpage describes how to check out the source code of this prototype, build the source code, install the just built compiler, and experience concept-based optimizations with it.
Obtaining the Source Code of the Prototype

Our prototype is available only as source code now. To retrieve the source code, you will need an installed Subversion client on your system. To checkout a latest copy of our prototype, use:

svn co https://svn.osl.iu.edu/svn/hlo/branches/optimization-with-axiom

Again, from Open Source Laboratory at Indiana University --- and poor Mikey with no username and password ...  :'(

Oh well ... It's not the end of the world.  I'm just at the end of my rope.

I promise to be satisfied with the standard g++ compiler with -std=c++11 ... I will just use that.

Like I said before, I have a tremendous amount to explore and learn before I could even make use of built-in concepts anyway.

So .............. If I could lock my self from this topic, I would.

Be satisfied that you did a build of gcc-5.2.0 from scratch ... and be content to explore SLOWLY.

You're Rip Van Winkle, and have been asleep for a long time.  You can't just barge into people's laboratories like you own the place.

Wait ... 3AM

Try this:

"git clone https://bitbucket.org/Blzut3/c-concepts.git"

https://bitbucket.org/Blzut3/c-concepts/src


« Last Edit: November 11, 2015, 04:01:52 pm by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4765
  • Life teaches me not to want it.
    • What Now?
ConceptGCC: bitbucket.org/Blzut3/c-concepts.git
« Reply #2 on: November 11, 2015, 04:03:58 am »
ok

4AM

In directory ~/concept_install

git clone https://bitbucket.org/Blzut3/c-concepts.git

That creates directory c-concepts with all subdirectories

Still in ~/concept_install, mkdir concept_build

sudo mkdir -p /opt/concept

cd ~/concept_install/concept_build

../c-concepts/configure --program-transform-name='s/^g++$/conceptg++/' --prefix=/opt/concept --enable-languages=c++ --with-gmp=/opt/gmp-6.1.0 --with-mpfr=/opt/mpfr-3.1.3 --with-mpc=/opt/mpc-1.0.3 --disable-multilib  --enable-shared --with-tune=generic --disable-checking --enable-multiarch --enable-threads=posix --without-included-gettext

make -j 4 && make check && sudo make install

Now, hopefully to compile with ConceptGCC, use the program conceptg++  :-X

This may not be the c++-concepts compiler, but I configure build options as if it were.  I will try to sleep during BUILD and INSTALL.

When I return to consciousness, it ought to be finished.

Things to check:

which gcc
which g++
whereis g++
whereis gcc
g++ --version
whereis conceptg++
which conceptg++
conceptg++ --version

Then reboot machine.

again:


which gcc
which g++
whereis g++
whereis gcc
g++ --version
whereis conceptg++
which conceptg++
conceptg++ --version

Depending on the responses ... what's next?

asutton.github.io/origin/start.html

note:  https://cmake.org/download/
« Last Edit: November 11, 2015, 04:02:20 pm by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4765
  • Life teaches me not to want it.
    • What Now?
ConceptGCC: -std=c++1z
« Reply #3 on: November 11, 2015, 12:46:13 pm »
Wowzers.  It compiled.  So as not to get this confused with g++ 5.2.0 which I can use -std=c++11, while configuring this "c-concepts" bundle, I did include

--program-transform-name='s/^g++$/conceptg++/'

as one of the flags.   In fact, at first I had forgotten, so I started over.

I use an alias rather than adding this to PATH, for the time being ... I don't want to move in a hap-hazard manner.

alias G='/opt/concept/bin/./conceptg++ -std=c++1z'

I use "G" for "generic programming"

That way, when I want to compile with the experimental "conceptg++" I just

G -g source.cpp -o program-name

instead of having to type /opt/concept/bin/./conceptg++ -g source.cpp -o program-name -std=c++1z

c++1z implies C++17

I am just learning about C++11 changes, co this "concepts" experiment is really just something I am keeping in mind even as I am only just beginning to look into STL and even the Standard Library itself. 

Anyway.  I just want to be follow along with things I am tinkering with (I wanted a compiler that could handle the -std=c++1z flag.

I'm just having fun with this.  That's not a sin, is it?

I tested it on code from Stepanov's From Mathematic to Generic Programming, which one has to use -std=c++11 flag when compiling with g++ (5.2.0 I used).  Without that magic flag, it won't compile, so just that alone is kind of exciting.

Anyway, to the point:  I was also able to compile that same code (Stepanov FM2GP ch11) with the /opt/concept/bin/./conceptg++ complier with the -std=c++1z flag, which may imply that -std=c++1z kind of includes -std=c++11.   I know this is crazy talk and nonsense, but this is what being human has come to. 

The raw truth is that I am taking deep breaths.  Breathe in -- pause -- breathe out ..... repeat.

while (excited)
{
unit_cycle = breathe in + pause + breathe out;
}

It seems almost clownish to say, but I think the way I am going to approach this (STL, generic programming, algorithmic mathematical thinking, c++11, c++17 (1z), etc) is to try to enjoy the journey of discovery rather than try to master anything. 

So, even if I am "all over the place" in my head, at least the areas are related, where exploring one leads back to the other. 

I'm just going to list a few links here so I can clear my mind and focus.  Having set up a "working environment" may motivate me to slow down: exploratory tinkering.

repository

c++17 (c++1z)

C++1z Support in GCC

status of c++1z

Quote
Stroustrup lists new features that could make it into C++17. Here are some of the possible features that are among Stroustrup’s preferred features:

    modules to improve locality and compile time
    contracts to improve specification
    type-safe unions, probably based on functional-programming style pattern matching
    concepts
    ranges
    uniform call syntax to simplify the specification and use of template libraries
    co-routines, i.e., resumable functions
    SIMD vector to better exploit modern hardware

Sometimes it's good to reboot the computer ... step away from the machine.  Crack open a big fat book:  The C++ Standard Library - A Tutorial and Reference, 2nd Edition (Josuttis)  - An $80 textbook I was able to get for $50.  I could have gotten it for even less, but I had my heart set on the hardcover edition since I am in student-mode. 
_______________________________________________________________________

IMPORTANT REMINDER CONCERNING WORKSPACE

NOTE: As with the build of gcc-5.2.0, where it is safe to remove ~/gcc_archive and all its contents once /opt/gcc-5.2.0/bin/g++ is tested, likewise, with the /opt/concept/bin/./conceptg++ compiler, once I saw that it handles the -std=c++1z flag, I can free much needed disk-space by removing concept_install.

The two of these folders together were about 9.4 GB  --- and my home partition had only 5 GB free space ... There were other folders from previous "builds" hidden in ~/.local/share/Trash/files ... not necessarily deleted.

remember:  cd ~/.local/share/Trash/files

sudo -s
To verify you are in correct location:  pwd

rm -fr *

It takes some time ... for me, it was 40 GB virtual refuse container.


Now ... leave it be and get back to the theory.  The environment is set up for when I want to "get my hands dirty".

 :D

« Last Edit: November 11, 2015, 04:03:28 pm by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4765
  • Life teaches me not to want it.
    • What Now?
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4765
  • Life teaches me not to want it.
    • What Now?
Re: Experiments With ConceptGCC
« Reply #5 on: November 24, 2018, 09:17:03 am »
Well, it looks as though we can test out concepts and modules using -std=c++20

Stroustrup on "Good Concepts"

From cppdepend:

Concepts are an extension to C++'s templates, published as an ISO Technical Specification ISO/IEC TS 19217:2015. (see [1] in Concepts C++).   They are named boolean predicates on template parameters, evaluated at compile time. A concept may be associated with a template (class template, function template, or member function of a class template), in which case it serves as a constraint: it limits the set of arguments that are accepted as template parameters.

I know this is of little interest here, but I just wanted to update the thread on Concepts in case someone were to stumble upon this thread.   There is no need to build the special concepts compiler.  We can just attach the -std=c++20 argument when compiling with g++.

My apologies for posting something that might only be of interest to yours truly.
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4765
  • Life teaches me not to want it.
    • What Now?
Re: Experiments With ConceptGCC
« Reply #6 on: September 21, 2019, 10:53:16 am »
Just for the record, Concepts is finding its way into the Core of C++:

Templates and generic programming  (at CppCoreGuidelines)

In a world of self-deceiving liars and mass scale hallucinations, one has to treasure some basic technical guidance when working alone.    It is weird, though.   Maybe I like it because it is weird.   Maybe I like math because it is weird.

Listen, you can't tell me that the eggheads creating these abstract programming environments and compilers are not total weirdos.   They act as if creating a programming language is a perfectly natural thing to do.   

Again, please ignore technical-oriented posts if it is of no interest.   

I may merge this with another thread, but for now will connect with, yes, a dirty little hyperlink to generic programming.

Also under this umbrella is Programming as Mathematics

As I type this I am hungry but do not want to eat.  I have pancake batter all made up, but just can't bring myself to heat them up and feed this Thing-Being.  How it loves to move its bowels!   The back hurts from sleeping on the small cot, who knows?   The funny thing about technical, scientific, or mathematical information is that the "editors" always leave out the depressing little details of their own lives.   It appears that leaving out the details about our existential quandaries (philosophy) is crucial in "technical writing."

Engaging in a programming project or even going over a little mathematics implies that, for the most part, one is able to keep one's life from falling to pieces.   It implies one has a room, kitchen, toilet, running water, electricity, an internet connection (for installing packages, tools, and environments, a "programming ecosystem."

To the youth who might stumble upon this message board:   If you want to study mathematics and programming, but do not have access to your own personal computer, or, you have no stable place to live, to store books, to heal, eat, and shiit in peace, then this world of computing with abstract concepts seems to be something done by those "on the Mother Ship," and not something for those of us thrown overboard thirty years ago.

All I am saying is that this stuff is mentally stimulating.   It is beyond good and evil.

As Silenus has reminded us, though, all these grand projects and technological accomplishments depend on our animal bodies eating and shiiting.

That no one mentions our shiiting-ness may have to do with the fact that such things are taken for granted.   

They would not want such a philosophical member on their "committee". 

Can mathematics and programming make life worth living to those of us who have lost our "lust for life" ?

While the media will make you think life is all about talent shows and "singing competitions" or basketball games, I'm here to tell you that there are far more interesting things to consider.

Not everyone will be interested in such things, and not all those who ARE interested in such things will have the opportunity to explore.  That is, one finds oneself a hungry animal, no matter how long we live, each morning we are still hungry animals.   It's amazing that we even do what we do.

I am sorry life is so difficult.    And it is LIFE itself that is difficult, not the math, not the programming.   It is the problem of living and the riddles of existence itself which make learning technical subjects challenging.     We can become tired, confused, and overwhelmed.     And, yes, we may wonder why we try so hard to improve our techniques when nothing ever seems to lead anywhere other than being another hungry animal on just another dangerous planet in this mysterious cosmos ...

Like Holden, I just don't know anymore.

As you can imagine, I often find myself wanting to just wanting to quit.

Does mathematics (or programming with numerics)  add a dimension to this poor wretched animal's existence?   Sure it does; but one must know from the start that any joy to be found must be found in the learning process, in the journey itself.    We can't live for ends.   By the time you learn something, you may find you could do things differently, and so you have to forget the "wrong ways" which seem right to you, but could be improved drastically.

If I live to be old, you would think that society might wish to place me in a position to "instruct others."    But, I am not foolish enough to think this will ever happen.  You see, society is mostly interested in producing "employees" who can "come up with the answers."    There is not much respect paid to those seeking to understand.   They want teachers who are confident in their wrong notions and wrong ideas.     They certainly don't want a honest man - always in the process of learning and trying to better understand - instructing their future "consumers," "clients," and "end users."

« Last Edit: September 21, 2019, 11:56:28 am by Broken Machinery »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~