Pope John Paul II, in his parting message to Africa, said today that he was encouraged by the spiritualism he has encountered in the continent, but he deplored its postindependence record of political turbulence and its materialistic elite classes.

He also criticized Marxism as a possible option for African development.

Coming at the end of a six-nation African tour, the pope's last statement before returning to Rome repeated several of the themes that he had made in the last 11 days.

He welcomed the religious enthusiasm he found, John Paul said, but added that in Africa "the temptation is big to demolish instead of build, to buy arms at great cost for populations that need bread, to want to grab power while the poor dream of peace, or succumb to the drunken desire for profit benefiting a privileged class."

"You do not have to run after artificial needs that give you illusory freedom or that lead you to individualism," the pope said to a huge crowd at Abidjan's Port Bouet Airport. In an apparent reference to Marxism, he added, "You also do not need to delude yourselves about the virtues of ideologies that make you dream of a complete happiness, which is always postponed until tomorrow."

During the trip's 75 or so speeches and sermons, John Paul, however, did not spell out to his consistently large audiences which earthly avenue was the best to follow for solutions to their political and economic problems.

The diverse political leadership in the countries he visited -- Zaire, Congo, Kenya, Ghana, Upper Volta and Ivory Coast -- probably would have reacted very negatively to what they might have interpreted as interference in their domestic politics.

He did step into several sensitive areas here -- at one point admonishing the church's bishops in Africa to speak out on human rights violations -- that could lead to strained relations between the church and African leaders. On another matter, the role of African traditions and culture in the church's ceremonies, the pope's statements appeared contradictory.

Vatican sources traveling with the pope emphasized that John Paul was speaking to all of Africa, but the pontiff tailored his themes at each stop to fit in with the particular country he was visiting. In the drought-stricken Sahel country of Upper Volta, he chastized the industrialized West for not doing more to help with Africa's food needs. In the relatively affluent Ivory Coast, where he toured the Treichville slums of Abidjan, he emphasized the chasm between the rich and poor.

At his first stop, in Kinshasa, Zaire, the pope criticized African polygamy and told church leaders that they must prepare their parishioners for a monogamous life.

Taut relations between the Catholic Church and Zaire's autocratic ruler, Mobutu Sese Seko only recently have been reconciled, but the pope told nine new bishops during a consecration ceremony that they must speak out when they feel fundamental human rights and liberties are being violated.

"You must pronounce yourselves on ethical aspects of society every time fundatmental human rights, liberties and the common good are at stake," said the pope in front of Kinshasa's archbishop, Joseph Malula.

Malula has been openly critical of the Mobutu government's human rights violations in the past but has been conspicuously silent over the last year.

In Zaire, the pope also cautioned against the "Africanization" of the church's liturgy and teachings, but at later stops he encouraged his African audiences to "remember and safeguard their cultural roots" in all parts of their lives.

During a brief stop in Marxist Congo, where relations between the government and the Catholic Church have also been difficult, the pope was conciliatory. He asked Congolese President Col. Denis Sassou-Nguesso that the church be allowed to operate freely and promised it would not endanger the state.

In East Africa's most capitalist capital, Nairobi, Kenya, the pope gave a speech that was clearly directed at the majority of Africa's strongman governments. Kenya, by comparison has a relatively democratic system although it is a one-party state.

The pope attacked abuses of authority, corruption and the use of violence and tyranny as political weapons. "In the state, citizens have a right and a duty to share in the political life," he said.

In his parting comments today, the pontiff left a traditional papal message of hope for this continent's future, but left it up to his hosts to define the route.

"You can show the world that you can solve your own problems with humanitarian, economic and cultural assistance, which is only right," he said, "but guided in the correct direction."